Skip to content

Commit 6771243

Browse files
Use golangci-lint 2.x (#1505)
/cherry-pick Signed-off-by: Arnab Baishnab Nipun <nipun@appscode.com> Signed-off-by: Tamal Saha <tamal@appscode.com> Co-authored-by: Tamal Saha <tamal@appscode.com>
1 parent 10a6b29 commit 6771243

File tree

128 files changed

+15763
-15404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+15763
-15404
lines changed

.golangci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: "2"
2+
linters:
3+
default: standard
4+
enable:
5+
- unparam
6+
7+
formatters:
8+
enable:
9+
- gofmt
10+
- goimports
11+
settings:
12+
gofmt:
13+
rewrite-rules:
14+
- pattern: 'interface{}'
15+
replacement: 'any'
16+
17+
issues:
18+
max-same-issues: 100
19+
20+
exclude-files:
21+
- generated.*\\.go
22+
23+
exclude-dirs:
24+
- client
25+
- vendor
26+
27+
run:
28+
timeout: 10m

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ lint: $(BUILD_DIRS)
281281
--env GO111MODULE=on \
282282
--env GOFLAGS="-mod=vendor" \
283283
$(BUILD_IMAGE) \
284-
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=30m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default --exclude-dirs=client,vendor
284+
golangci-lint run
285285

286286
$(BUILD_DIRS):
287287
@mkdir -p $@

go.mod

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module stash.appscode.dev/postgres
22

3-
go 1.23.0
4-
5-
toolchain go1.24.4
3+
go 1.24.0
64

75
require (
86
github.com/spf13/cobra v1.8.0
@@ -18,7 +16,7 @@ require (
1816
kmodules.xyz/client-go v0.30.44
1917
kmodules.xyz/custom-resources v0.30.0
2018
kmodules.xyz/offshoot-api v0.30.1
21-
stash.appscode.dev/apimachinery v0.42.0
19+
stash.appscode.dev/apimachinery v0.42.1-0.20251212062910-cc7cccc43100
2220
)
2321

2422
require (
@@ -80,11 +78,11 @@ require (
8078
go.bytebuilders.dev/license-proxyserver v0.0.20 // indirect
8179
go.bytebuilders.dev/license-verifier v0.14.6 // indirect
8280
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
83-
golang.org/x/net v0.38.0 // indirect
81+
golang.org/x/net v0.47.0 // indirect
8482
golang.org/x/oauth2 v0.27.0 // indirect
85-
golang.org/x/sys v0.31.0 // indirect
86-
golang.org/x/term v0.30.0 // indirect
87-
golang.org/x/text v0.23.0 // indirect
83+
golang.org/x/sys v0.38.0 // indirect
84+
golang.org/x/term v0.37.0 // indirect
85+
golang.org/x/text v0.31.0 // indirect
8886
golang.org/x/time v0.5.0 // indirect
8987
gomodules.xyz/clock v0.0.0-20200817085942-06523dba733f // indirect
9088
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect

go.sum

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
377377
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
378378
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
379379
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
380-
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
381-
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
380+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
381+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
382382
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
383383
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
384384
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -406,16 +406,16 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
406406
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
407407
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
408408
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
409-
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
410-
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
411-
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
412-
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
409+
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
410+
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
411+
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
412+
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
413413
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
414414
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
415415
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
416416
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
417-
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
418-
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
417+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
418+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
419419
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
420420
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
421421
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
@@ -440,8 +440,8 @@ golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtn
440440
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
441441
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
442442
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
443-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
444-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
443+
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
444+
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
445445
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
446446
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
447447
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -554,5 +554,5 @@ sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+s
554554
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
555555
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
556556
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
557-
stash.appscode.dev/apimachinery v0.42.0 h1:tqGAhAbII/WoYxM4LyQW+Hc6jgjRgBYUcI3AORwBLYs=
558-
stash.appscode.dev/apimachinery v0.42.0/go.mod h1:Q7iqhJAS0n7IV545NxaYNE5C31bBrWklZj7SfjOyryc=
557+
stash.appscode.dev/apimachinery v0.42.1-0.20251212062910-cc7cccc43100 h1:Y3Y70xEQc+/TtMEt8IW/VY7Iz1cNRfSc5+CcZGgKUK4=
558+
stash.appscode.dev/apimachinery v0.42.1-0.20251212062910-cc7cccc43100/go.mod h1:uxzHr2lfPtGuryxTwjvcS9H8A9WCMyUr6+0dQYJiTIA=

lintconf.yaml

Lines changed: 0 additions & 43 deletions
This file was deleted.

pkg/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (opt *postgresOptions) restorePostgreSQL(targetRef api_v1beta1.TargetRef) (
186186
// So, we are going to use "sed" to remove the password altering line from the sql file.
187187
passwordOverwriteRemover := restic.Command{
188188
Name: SedCMD,
189-
Args: []interface{}{sedArgs},
189+
Args: []any{sedArgs},
190190
}
191191

192192
// The backup process should follow the following pipeline: restic restore | sed <args> | psql -f dumpfile.sql .

pkg/util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"k8s.io/klog/v2"
3636
kmapi "kmodules.xyz/client-go/api/v1"
3737
meta_util "kmodules.xyz/client-go/meta"
38-
"kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
3938
appcatalog "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
4039
appcatalog_cs "kmodules.xyz/custom-resources/client/clientset/versioned"
4140
)
@@ -203,7 +202,7 @@ func (session *sessionWrapper) waitForDBReady(waitTimeout int32) error {
203202
return session.sh.Command("pg_isready", args...).Run()
204203
}
205204

206-
func getSSLMODE(appBinding *v1alpha1.AppBinding) (string, error) {
205+
func getSSLMODE(appBinding *appcatalog.AppBinding) (string, error) {
207206
if appBinding.Spec.ClientConfig.Service != nil {
208207
sslmodeString := appBinding.Spec.ClientConfig.Service.Query
209208
if sslmodeString == "" {

vendor/golang.org/x/net/html/escape.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/net/html/parse.go

Lines changed: 41 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/net/html/render.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)