mirror of
https://github.com/securego/gosec.git
synced 2024-12-25 12:05:52 +00:00
use a better naming for the variable (#715)
Signed-off-by: Ryan Leung <rleungx@gmail.com>
This commit is contained in:
parent
69213955da
commit
79c8b79263
1 changed files with 4 additions and 4 deletions
|
@ -247,9 +247,9 @@ func saveReport(filename, format string, rootPaths []string, reportInfo *gosec.R
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertToScore(severity string) (gosec.Score, error) {
|
func convertToScore(value string) (gosec.Score, error) {
|
||||||
severity = strings.ToLower(severity)
|
value = strings.ToLower(value)
|
||||||
switch severity {
|
switch value {
|
||||||
case "low":
|
case "low":
|
||||||
return gosec.Low, nil
|
return gosec.Low, nil
|
||||||
case "medium":
|
case "medium":
|
||||||
|
@ -257,7 +257,7 @@ func convertToScore(severity string) (gosec.Score, error) {
|
||||||
case "high":
|
case "high":
|
||||||
return gosec.High, nil
|
return gosec.High, nil
|
||||||
default:
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue