From dd6feb16662b5ae43ccb5319538a256432255ed1 Mon Sep 17 00:00:00 2001 From: David Gomez Date: Mon, 26 Aug 2024 14:59:26 +0200 Subject: [PATCH] Fix linter error SCC-SA1006 Signed-off-by: David Gomez --- cmd/common.go | 9 +++++---- main.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/common.go b/cmd/common.go index 3d003a9..0c5f07f 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -1,6 +1,7 @@ package cmd import ( + "errors" "fmt" "os" "strings" @@ -160,15 +161,15 @@ func getChecksManager() interface { } return manager } -func flattenErrors(errors []error) error { - if len(errors) == 0 { +func flattenErrors(errList []error) error { + if len(errList) == 0 { return nil } msgs := []string{} - for _, err := range errors { + for _, err := range errList { msgs = append(msgs, err.Error()) } - return fmt.Errorf(strings.Join(msgs, "\n")) + return return errors.New(strings.Join(msgs, "\n")) } type serviceCommand struct { diff --git a/main.go b/main.go index 23f379c..d4ae9c4 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,7 @@ import ( "github.com/bitnami/gonit/cmd" ) -var version = "0.2.10" +var version = "0.2.11" var buildDate = "" var commit = ""