Merge pull request #8673 from mmorel-35/revive/unnecessary-stmt

chore: enable unnecessary-stmt from revive
pull/8674/head
Tiger Kaovilai 2025-02-11 02:50:29 +07:00 committed by GitHub
commit 5d9a4e84cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 11 deletions

View File

@ -272,7 +272,6 @@ linters-settings:
- name: unexported-return
disabled: true
- name: unnecessary-stmt
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true

View File

@ -117,14 +117,9 @@ func applyPatchToObject(
})
}
} else if len(strictErrs) > 0 {
switch {
//case validationDirective == metav1.FieldValidationWarn:
// addStrictDecodingWarnings(requestContext, strictErrs)
default:
return apierrors.NewInvalid(schema.GroupKind{}, "", field.ErrorList{
field.Invalid(field.NewPath("patch"), fmt.Sprintf("%+v", patchMap), runtime.NewStrictDecodingError(strictErrs).Error()),
})
}
return apierrors.NewInvalid(schema.GroupKind{}, "", field.ErrorList{
field.Invalid(field.NewPath("patch"), fmt.Sprintf("%+v", patchMap), runtime.NewStrictDecodingError(strictErrs).Error()),
})
}
return nil

View File

@ -37,8 +37,7 @@ func FromGRPCError(err error) error {
}
for _, detail := range statusErr.Details() {
switch t := detail.(type) {
case *proto.Stack:
if t, ok := detail.(*proto.Stack); ok {
return &ProtoStackError{
error: err,
stack: t,