Skip to content

Commit

Permalink
Merge pull request #8673 from mmorel-35/revive/unnecessary-stmt
Browse files Browse the repository at this point in the history
chore: enable unnecessary-stmt from revive
  • Loading branch information
kaovilai authored Feb 10, 2025
2 parents 0bf2252 + 9010d9b commit 5d9a4e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ linters-settings:
- name: unexported-return
disabled: true
- name: unnecessary-stmt
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true
Expand Down
11 changes: 3 additions & 8 deletions internal/resourcemodifiers/strategic_merge_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions pkg/plugin/framework/common/client_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5d9a4e8

Please sign in to comment.