1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-03 00:27:05 +02:00

Refactor how ignored issues are tracked

Track ignored issues using file location instead of a AST node. There are issues linked to a different AST node than the original node used to start the scan.

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
This commit is contained in:
Cosmin Cojocar
2023-10-13 14:04:21 +02:00
committed by Cosmin Cojocar
parent f338a98bf3
commit 0ec6cd95d7
5 changed files with 58 additions and 67 deletions

View File

@ -53,9 +53,9 @@ func (p *TestPackage) write() error {
return nil
}
for filename, content := range p.Files {
if e := os.WriteFile(filename, []byte(content), 0o644); e != nil {
if e := os.WriteFile(filename, []byte(content), 0o644); e != nil /* #nosec G306 */ {
return e
} //#nosec G306
}
}
p.onDisk = true
return nil