Merge pull request #4498 from chaosi-zju/lint-error-strings

cleanup: enable revive(error-strings) checking
This commit is contained in:
karmada-bot 2024-01-03 11:03:27 +08:00 committed by GitHub
commit a1c1eedcc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -69,6 +69,7 @@ linters-settings:
- name: superfluous-else
arguments:
- preserveScope
- name: error-strings
staticcheck:
checks:
- all

View File

@ -190,7 +190,7 @@ func reactionFuncForGetting(c client.Client, mapper meta.RESTMapper) coretesting
return func(action coretesting.Action) (bool, runtime.Object, error) {
getAction, ok := action.(coretesting.GetAction)
if !ok {
return false, nil, fmt.Errorf("Not GET Action!")
return false, nil, fmt.Errorf("not GET Action")
}
obj, err := newUnstructured(getAction.GetResource(), mapper)
@ -243,12 +243,12 @@ func reactionFuncForUpdating(c client.Client, mapper meta.RESTMapper) coretestin
return func(action coretesting.Action) (bool, runtime.Object, error) {
updateAction, ok := action.(coretesting.UpdateAction)
if !ok {
return false, nil, fmt.Errorf("Not UPDATE Action!")
return false, nil, fmt.Errorf("not UPDATE Action")
}
scale, ok := updateAction.GetObject().(*autoscalingv1.Scale)
if !ok {
return false, nil, fmt.Errorf("Not autoscalingv1.Scale Object!")
return false, nil, fmt.Errorf("not autoscalingv1.Scale Object")
}
obj, err := newUnstructured(updateAction.GetResource(), mapper)