1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-17 01:12:33 +02:00

Allow excluding analyzers globally (#1180)

* This change does not exclude analyzers for inline comment
* Changed the expected issues count for G103, G109 samples for test. Previously G115 has been included in the issue count
* Show analyzers IDs(G115, G602) in gosec usage help
* See #1175
This commit is contained in:
Rahul Gadi
2024-08-20 04:43:40 -04:00
committed by GitHub
parent 18135b439c
commit 81cda2f91f
11 changed files with 301 additions and 26 deletions

View File

@ -27,7 +27,7 @@ func main() {
intPtr = (*int)(unsafe.Pointer(addressHolder))
fmt.Printf("\nintPtr=%p, *intPtr=%d.\n\n", intPtr, *intPtr)
}
`}, 3, gosec.NewConfig()},
`}, 2, gosec.NewConfig()},
{[]string{`
package main

View File

@ -20,7 +20,7 @@ func main() {
value := int32(bigValue)
fmt.Println(value)
}
`}, 2, gosec.NewConfig()},
`}, 1, gosec.NewConfig()},
{[]string{`
package main
@ -38,7 +38,7 @@ func main() {
fmt.Println(bigValue)
}
}
`}, 2, gosec.NewConfig()},
`}, 1, gosec.NewConfig()},
{[]string{`
package main