mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
init
This commit is contained in:
1 parent
9326f35380
commit
593bb6ffad
11 files changed
+345
-698
No files matched your search
+5
-2
@@ -10,7 +10,7 @@ type Location struct {
|
||||
endLineIndex int
|
||||
}
|
||||
|
||||
func getLocation(linePairs [][]int, start int, end int) Location {
|
||||
func location(fragment Fragment, matchIndex []int) Location {
|
||||
var (
|
||||
prevNewLine int
|
||||
location Location
|
||||
@@ -18,7 +18,10 @@ func getLocation(linePairs [][]int, start int, end int) Location {
|
||||
_lineNum int
|
||||
)
|
||||
|
||||
for lineNum, pair := range linePairs {
|
||||
start := matchIndex[0]
|
||||
end := matchIndex[1]
|
||||
|
||||
for lineNum, pair := range fragment.newlineIndices {
|
||||
_lineNum = lineNum
|
||||
newLineByteIndex := pair[0]
|
||||
if prevNewLine <= start && start < newLineByteIndex {
|
||||
|
||||
Reference in new issue
Block a user