From 99495e913acf9fefcfae0144662d9e4c7a35d78d Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Mon, 18 Oct 2021 15:23:03 +0800 Subject: [PATCH] use a better naming for the variable Signed-off-by: Ryan Leung --- cmd/gosec/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/gosec/main.go b/cmd/gosec/main.go index acfa850e22..c007e08fc3 100644 --- a/cmd/gosec/main.go +++ b/cmd/gosec/main.go @@ -247,9 +247,9 @@ func saveReport(filename, format string, rootPaths []string, reportInfo *gosec.R return nil } -func convertToScore(severity string) (gosec.Score, error) { - severity = strings.ToLower(severity) - switch severity { +func convertToScore(value string) (gosec.Score, error) { + value = strings.ToLower(value) + switch value { case "low": return gosec.Low, nil case "medium": @@ -257,7 +257,7 @@ func convertToScore(severity string) (gosec.Score, error) { case "high": return gosec.High, nil default: - return gosec.Low, fmt.Errorf("provided severity '%s' not valid. Valid options: low, medium, high", severity) + return gosec.Low, fmt.Errorf("provided value '%s' not valid. Valid options: low, medium, high", value) } }