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