mirror of
https://github.com/securego/gosec.git
synced 2025-07-15 01:04:43 +02:00
Fix nosec when applied to a block
Handle properly nosec directive when applied to a block or as a single line on a multi-line issue. Signed-off-by: Cosmin Cojocar <cosmin@cojocar.ch>
This commit is contained in:
@ -122,7 +122,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 start <= i.start && end >= i.end {
|
||||
if i.start <= start && i.end >= end || start <= i.start && end >= i.end {
|
||||
return i.suppressions
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user