1
0
mirror of https://github.com/securego/gosec.git synced 2025-11-23 22:15:04 +02:00

Ensure ignores are handled properly for multi-line issues

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
Cosmin Cojocar
2023-11-10 10:28:38 +01:00
committed by Cosmin Cojocar
parent 6d56592f09
commit 3188e3fb8e
2 changed files with 33 additions and 1 deletions

View File

@@ -123,7 +123,7 @@ func (i ignores) get(file string, line string) map[string][]issue.SuppressionInf
start, end := i.parseLine(line)
if is, ok := i[file]; ok {
for _, i := range is {
if i.start <= start && i.end >= end {
if start <= i.start && end >= i.end {
return i.suppressions
}
}