Skip to content

Commit 439bcd4

Browse files
committed
build: Upgrade to golang v1.41.1 and satisfy new linters
1 parent 64403ae commit 439bcd4

File tree

7 files changed

+397
-131
lines changed

7 files changed

+397
-131
lines changed

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,22 @@ linters:
1818
- dogsled
1919
- dupl
2020
- errcheck
21+
- exportloopref
2122
# - funlen # the kubernetes custom storage func signatures will always violate this rule.
2223
# - gochecknoinits
2324
- goconst
2425
- gocritic
2526
- gocyclo
2627
- gofmt
2728
- goimports
28-
- golint
2929
- gosec
3030
- gosimple
3131
- govet
3232
- ineffassign
33-
- interfacer
3433
- lll
3534
- misspell
3635
- nakedret
37-
- scopelint
36+
- revive
3837
- staticcheck
3938
- structcheck
4039
- stylecheck

doc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ limitations under the License.
2121
// Note that this package is experimental and a work in progress. Do not rely on this project for production
2222
// without first contacting the maintainers at [email protected].
2323
//
24-
// nolint:stylecheck,golint
25-
package apiserver_runtime
24+
package apiserver_runtime // nolint:stylecheck,revive

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ go 1.15
66

77
require (
88
github.com/go-openapi/spec v0.19.5
9-
github.com/golangci/golangci-lint v1.31.0
9+
github.com/golangci/golangci-lint v1.41.1
1010
github.com/google/gofuzz v1.1.0
1111
github.com/rancher/kine v0.4.0
1212
github.com/spf13/cobra v1.1.3

go.sum

Lines changed: 391 additions & 115 deletions
Large diffs are not rendered by default.

pkg/builder/resource/resourcerest/interface.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ type Connecter = rest.Connecter
4343
// Go prevents embedded interfaces that implement the same method.
4444
type CreaterUpdater = rest.CreaterUpdater
4545

46-
// Exporter is an object that knows how to strip a RESTful resource for export. A store should implement this interface
47-
// if export is generally supported for that type. Errors can still be returned during the actual Export when certain
48-
// instances of the type are not exportable.
49-
type Exporter = rest.Exporter
50-
5146
// Getter if implemented will expose GET endpoints for the resource and publish them in the Kubernetes
5247
// discovery service and OpenAPI.
5348
//

pkg/util/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
type parentStorageContextKeyType string
1010

11-
var parentStorageContextKey parentStorageContextKeyType = ""
11+
var parentStorageContextKey parentStorageContextKeyType
1212

1313
// WithParentStorage creates a new child context w/ parent storage plumbed
1414
func WithParentStorage(ctx context.Context, storage rest.StandardStorage) context.Context {

tools/apiserver-runtime-gen/main.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,7 @@ func run(cmd *exec.Cmd) error {
216216
cmd.Stdout = os.Stdout
217217
cmd.Stderr = os.Stderr
218218
cmd.Stdin = os.Stdin
219-
if err := cmd.Run(); err != nil {
220-
return err
221-
}
222-
return nil
219+
return cmd.Run()
223220
}
224221

225222
func getCmd(cmd string, args ...string) *exec.Cmd {

0 commit comments

Comments
 (0)