From c5e6c4aedd427f4c5113af3e907228db6d3a0102 Mon Sep 17 00:00:00 2001 From: JulesDT Date: Mon, 18 Mar 2019 17:22:29 -0400 Subject: [PATCH] fix no-fail flag logic --- cmd/gosec/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/gosec/main.go b/cmd/gosec/main.go index 09e65da..b1755a4 100644 --- a/cmd/gosec/main.go +++ b/cmd/gosec/main.go @@ -352,7 +352,7 @@ func main() { logWriter.Close() // #nosec // Do we have an issue? If so exit 1 unless NoFail is set - if issuesFound && !*flagNoFail || len(errors) != 0 { + if (issuesFound || len(errors) != 0) && !*flagNoFail { os.Exit(1) } }