mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Allow tag (#809)
* gitleaks:allow signature * readd all tests * fixing tests
This commit is contained in:
1 parent
57f9bc83d1
commit
3e5e63956e
3 files changed
+78
-10
No files matched your search
+16
-2
@@ -46,8 +46,22 @@ func location(fragment Fragment, matchIndex []int) Location {
|
||||
// a newline
|
||||
location.startColumn = (start - prevNewLine) + 1 // +1 because counting starts at 1
|
||||
location.endColumn = (end - prevNewLine)
|
||||
location.startLine = _lineNum + 1
|
||||
location.endLine = _lineNum + 1
|
||||
location.startLine = _lineNum
|
||||
location.endLine = _lineNum
|
||||
location.startLineIndex = start
|
||||
|
||||
// search for new line byte index
|
||||
i := 0
|
||||
for end+i < len(fragment.Raw) {
|
||||
if fragment.Raw[end+i] == '\n' {
|
||||
break
|
||||
}
|
||||
if fragment.Raw[end+i] == '\r' {
|
||||
break
|
||||
}
|
||||
i++
|
||||
}
|
||||
location.endLineIndex = end + i
|
||||
}
|
||||
return location
|
||||
}
|
||||
Reference in new issue
Block a user