mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00:00
add a no-fail flag
This commit is contained in:
parent
a966ff760c
commit
04ce7baf6c
1 changed files with 5 additions and 2 deletions
|
@ -97,6 +97,9 @@ var (
|
||||||
// fail by severity
|
// fail by severity
|
||||||
flagSeverity = flag.String("severity", "low", "Fail the scanning for issues with the given or higher severity. Valid options are: low, medium, high")
|
flagSeverity = flag.String("severity", "low", "Fail the scanning for issues with the given or higher severity. Valid options are: low, medium, high")
|
||||||
|
|
||||||
|
// do not fail
|
||||||
|
flagNoFail = flag.Bool("no-fail", false, "Do not fail the scanning, even if issues were found")
|
||||||
|
|
||||||
logger *log.Logger
|
logger *log.Logger
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -348,8 +351,8 @@ func main() {
|
||||||
// Finalize logging
|
// Finalize logging
|
||||||
logWriter.Close() // #nosec
|
logWriter.Close() // #nosec
|
||||||
|
|
||||||
// Do we have an issue? If so exit 1
|
// Do we have an issue? If so exit 1 unless NoFail is set
|
||||||
if issuesFound {
|
if issuesFound && !*flagNoFail {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue