mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 19:45:51 +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
|
||||
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
|
||||
)
|
||||
|
||||
|
@ -348,8 +351,8 @@ func main() {
|
|||
// Finalize logging
|
||||
logWriter.Close() // #nosec
|
||||
|
||||
// Do we have an issue? If so exit 1
|
||||
if issuesFound {
|
||||
// Do we have an issue? If so exit 1 unless NoFail is set
|
||||
if issuesFound && !*flagNoFail {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue