Update linter and fix warnings

This commit is contained in:
Mikhail Mazurskiy 2023-08-09 12:55:10 +10:00
parent 542546c01d
commit ac3bd31c1f
No known key found for this signature in database
GPG Key ID: FA7917C48932DD55
4 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
run:
deadline: 5m
deadline: 30m
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
@ -10,7 +10,7 @@ linters:
disable-all: true
enable:
- bodyclose
- depguard
# - depguard
- dogsled
- dupl
- errcheck
@ -53,4 +53,5 @@ issues:
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- Using the variable on range scope `tc` in function literal
- "Using the variable on range scope `tc` in function literal"
- "unused-parameter: parameter"

View File

@ -16,7 +16,7 @@ all: generate license fix vet fmt test lint tidy
go install github.com/google/addlicense@v1.0.0
"$(MYGOBIN)/golangci-lint":
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
"$(MYGOBIN)/deepcopy-gen":
go install k8s.io/code-generator/cmd/deepcopy-gen@v0.25.2

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
run:
deadline: 5m
deadline: 30m
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
@ -11,7 +11,7 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
# - depguard
- dogsled
- dupl
- errcheck

View File

@ -81,11 +81,10 @@ func SetNamespaces(mapper meta.RESTMapper, objs []*unstructured.Unstructured,
// of unknown types.
unknownGVKs = append(unknownGVKs, unknownTypeError.GroupVersionKind)
continue
} else {
// If something went wrong when looking up the scope, just
// give up.
return err
}
// If something went wrong when looking up the scope, just
// give up.
return err
}
switch scope {