From db0ec03dcda746bb715fdc34f89dd42b7859e87e Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Thu, 20 Jun 2024 21:59:47 -0700 Subject: [PATCH] SAST: Resolve gosec G304 --- cmd/HellPot/HellPot.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/HellPot/HellPot.go b/cmd/HellPot/HellPot.go index d562f82..7ca4956 100644 --- a/cmd/HellPot/HellPot.go +++ b/cmd/HellPot/HellPot.go @@ -23,7 +23,8 @@ var ( func writeConfig(target string) bool { var f *os.File var err error - if f, err = os.Create(target); err != nil { + f, err = os.Create(target) // #nosec G304 -- go home gosec, you're drunk + if err != nil { println("failed to create config file: " + err.Error()) return false } @@ -70,7 +71,7 @@ func main() { var err error var f *os.File - f, err = os.Open(resolvedConf) + f, err = os.Open(resolvedConf) // #nosec G304 go home gosec, you're drunk if err == nil { runningConfig, setupErr = config.Setup(f) }