Skip to content

Commit

Permalink
Rework code to not trigger false positive in gosec
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Nov 11, 2024
1 parent 8bd9b6e commit 035bbb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion settings/appearance/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func ValueToColorScheme(value any) (ColorScheme, error) {
}

if result > 2 {
result = 0 // Unknown values should be treated as 0 (no preference).
return 0, nil // Unknown values should be treated as 0 (no preference).
}

return ColorScheme(result), nil
Expand Down
2 changes: 1 addition & 1 deletion settings/appearance/contrast.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func ValueToContrast(value any) (Contrast, error) {
}

if result > 1 {
result = 0 // Unknown values should be treated as 0 (no preference).
return 0, nil // Unknown values should be treated as 0 (no preference).
}

return Contrast(result), nil
Expand Down

0 comments on commit 035bbb7

Please sign in to comment.