Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a better naming for the variable #715

Merged
merged 1 commit into from Oct 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions cmd/gosec/main.go
Expand Up @@ -247,17 +247,17 @@ 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":
return gosec.Medium, nil
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)
}
}

Expand Down