Skip to content

Commit d7df578

Browse files
committed
chore: upgrade to go 1.22.3
also linting fixes related to jenkins-x/jx#8670
1 parent 6f2e6f9 commit d7df578

File tree

7 files changed

+151
-685
lines changed

7 files changed

+151
-685
lines changed

.golangci.yml

+31-78
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
linters-settings:
22
depguard:
3-
list-type: blacklist
4-
packages:
5-
# logging is allowed only by logutils.Log, logrus
6-
# is allowed to use only in logutils package
7-
- github.com/sirupsen/logrus
8-
- github.com/jenkins-x/jx/
9-
- github.com/jenkins-x/jx/v2/
10-
packages-with-error-message:
11-
- github.com/sirupsen/logrus: "logging is allowed only by jenkins-x/jx-logging"
12-
- github.com/jenkins-x/jx/: "you should not directly import jx"
13-
- github.com/jenkins-x/jx/v2/: "you should not directly import jx v2"
3+
rules:
4+
# Name of a rule.
5+
Main:
6+
list-mode: lax
7+
deny:
8+
- pkg: github.com/jenkins-x/jx/v2/pkg/log/
9+
desc: "use jenkins-x/jx-logging instead"
10+
- pkg: github.com/satori/go.uuid
11+
desc: "use github.com/google/uuid instead"
12+
- pkg: github.com/pborman/uuid
13+
desc: "use github.com/google/uuid instead"
1414
dupl:
1515
threshold: 100
1616
exhaustive:
@@ -34,33 +34,31 @@ linters-settings:
3434
- octalLiteral
3535
- whyNoLint
3636
- wrapperFunc
37+
- importShadow # not important for now
38+
- unnamedResult # not important
3739
gocyclo:
3840
min-complexity: 15
39-
goimports:
40-
golint:
41-
min-confidence: 0
42-
gomnd:
43-
settings:
44-
mnd:
45-
# don't include the "operation" and "assign"
46-
checks: argument,case,condition,return
41+
goimports: {}
42+
revive:
43+
confidence: 0
44+
gofmt:
45+
simplify: true
46+
mnd:
47+
# don't include the "operation" and "assign"
48+
checks: [argument, case, condition, return]
4749
govet:
48-
check-shadowing: true
4950
settings:
5051
printf:
5152
funcs:
52-
- (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Debugf
53-
- (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Infof
54-
- (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Warnf
55-
- (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Errorf
56-
- (github.com/jenkins-x/jx-logging/pkg/log/Logger()).Fatalf
53+
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Debugf
54+
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Infof
55+
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Warnf
56+
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Errorf
57+
- (github.com/jenkins-x/jx-logging/v3/pkg/log/Logger()).Fatalf
5758
lll:
5859
line-length: 140
59-
maligned:
60-
suggest-new: true
61-
misspell:
60+
misspell: {}
6261
nolintlint:
63-
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
6462
allow-unused: false # report any unused nolint directives
6563
require-explanation: false # don't require an explanation for nolint directives
6664
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
@@ -71,72 +69,27 @@ linters:
7169
enable:
7270
- asciicheck
7371
- bodyclose
74-
- deadcode
7572
- depguard
76-
- dogsled
77-
- dupl
7873
- errcheck
79-
- funlen
80-
- goconst
8174
- gofmt
8275
- goimports
8376
- goprintffuncname
8477
- gosec
8578
- gosimple
8679
- ineffassign
87-
- interfacer
8880
- misspell
8981
- nakedret
9082
- rowserrcheck
9183
- staticcheck
92-
- structcheck
9384
- typecheck
9485
- unconvert
9586
- unparam
9687
- unused
97-
- varcheck
98-
- testpackage
99-
- golint
88+
- revive
10089
- gocritic
101-
- gocyclo
102-
- nestif
103-
# don't enable:
104-
# - gochecknoinits
105-
# - stylecheck
106-
# - lll
107-
# - govet
108-
# - whitespace
109-
# - exhaustive (TODO: enable after next release; current release at time of writing is v1.27)
110-
# - gochecknoglobals
111-
# - gocognit
112-
# - godot
113-
# - godox
114-
# - goerr113
115-
# - maligned
116-
# - prealloc
117-
# - wsl
118-
# - nolintlint
119-
# - gomnd
120-
# - scopelint
121-
issues:
122-
# Excluding configuration per-path, per-linter, per-text and per-source
123-
exclude-rules:
124-
- path: _test\.go
125-
linters:
126-
- gomnd
127-
# https://github.com/go-critic/go-critic/issues/926
128-
- linters:
129-
- gocritic
130-
text: "unnecessaryDefer:"
90+
- govet
91+
13192
run:
132-
skip-dirs:
133-
- test/testdata_etc
134-
- internal/cache
135-
- internal/renameio
136-
- internal/robustio
93+
timeout: 30m
13794
# golangci.com configuration
13895
# https://github.com/golangci/golangci/wiki/Configuration
139-
service:
140-
golangci-lint-version: 1.27.x # use the fixed version to not introduce new linters unexpectedly
141-
prepare:
142-
- echo "here I can run custom commands, but no preparation needed for this repo"

go.mod

+30-33
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,48 @@
11
module github.com/jenkins-x/jx-kube-client/v3
22

33
require (
4-
github.com/pkg/errors v0.9.1
5-
k8s.io/apimachinery v0.23.14
6-
k8s.io/client-go v0.23.14
4+
k8s.io/apimachinery v0.30.1
5+
k8s.io/client-go v0.30.1
76
)
87

98
require (
10-
cloud.google.com/go v0.81.0 // indirect
11-
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
12-
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
13-
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
14-
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
15-
github.com/Azure/go-autorest/logger v0.2.1 // indirect
16-
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
179
github.com/davecgh/go-spew v1.1.1 // indirect
18-
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
19-
github.com/go-logr/logr v1.2.0 // indirect
10+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
11+
github.com/go-logr/logr v1.4.1 // indirect
12+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
13+
github.com/go-openapi/jsonreference v0.20.2 // indirect
14+
github.com/go-openapi/swag v0.22.3 // indirect
2015
github.com/gogo/protobuf v1.3.2 // indirect
21-
github.com/golang/protobuf v1.5.2 // indirect
22-
github.com/google/go-cmp v0.5.5 // indirect
23-
github.com/google/gofuzz v1.1.0 // indirect
24-
github.com/googleapis/gnostic v0.5.5 // indirect
25-
github.com/imdario/mergo v0.3.5 // indirect
16+
github.com/golang/protobuf v1.5.4 // indirect
17+
github.com/google/gnostic-models v0.6.8 // indirect
18+
github.com/google/gofuzz v1.2.0 // indirect
19+
github.com/google/uuid v1.3.0 // indirect
20+
github.com/imdario/mergo v0.3.6 // indirect
21+
github.com/josharian/intern v1.0.0 // indirect
2622
github.com/json-iterator/go v1.1.12 // indirect
23+
github.com/mailru/easyjson v0.7.7 // indirect
2724
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2825
github.com/modern-go/reflect2 v1.0.2 // indirect
26+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
2927
github.com/spf13/pflag v1.0.5 // indirect
30-
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
31-
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
32-
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
33-
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e // indirect
34-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
35-
golang.org/x/text v0.3.7 // indirect
36-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
28+
golang.org/x/net v0.23.0 // indirect
29+
golang.org/x/oauth2 v0.10.0 // indirect
30+
golang.org/x/sys v0.18.0 // indirect
31+
golang.org/x/term v0.18.0 // indirect
32+
golang.org/x/text v0.14.0 // indirect
33+
golang.org/x/time v0.3.0 // indirect
3734
google.golang.org/appengine v1.6.7 // indirect
38-
google.golang.org/protobuf v1.27.1 // indirect
35+
google.golang.org/protobuf v1.34.1 // indirect
3936
gopkg.in/inf.v0 v0.9.1 // indirect
4037
gopkg.in/yaml.v2 v2.4.0 // indirect
4138
gopkg.in/yaml.v3 v3.0.1 // indirect
42-
k8s.io/api v0.23.14 // indirect
43-
k8s.io/klog/v2 v2.30.0 // indirect
44-
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
45-
k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect
46-
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect
47-
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
48-
sigs.k8s.io/yaml v1.2.0 // indirect
39+
k8s.io/api v0.30.1 // indirect
40+
k8s.io/klog/v2 v2.120.1 // indirect
41+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
42+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
43+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
44+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
45+
sigs.k8s.io/yaml v1.3.0 // indirect
4946
)
5047

51-
go 1.19
48+
go 1.22.3

0 commit comments

Comments
 (0)