From 5ad37a931b1376d94838951e2d2aba3b156bee07 Mon Sep 17 00:00:00 2001 From: k1LoW Date: Wed, 5 May 2021 06:32:53 +0900 Subject: [PATCH] Fix gosec warn --- cmd/root.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 38f3af39..538a9026 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -71,16 +71,14 @@ var rootCmd = &cobra.Command{ // Generate badge if c.BadgeConfigReady() || genbadge { - var ( - out *os.File - err error - ) + var out *os.File cp := r.CoveragePercent() if c.Coverage.Badge == "" { out = os.Stdout } else { cmd.PrintErrln("Generate coverage report badge...") - if err := os.MkdirAll(filepath.Dir(c.Coverage.Badge), 0755); err != nil { // #nosec + err := os.MkdirAll(filepath.Dir(c.Coverage.Badge), 0755) // #nosec + if err != nil { return err } out, err = os.OpenFile(filepath.Clean(c.Coverage.Badge), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) // #nosec