Skip to content

Commit 37ee9f6

Browse files
committed
Update golanci-lint to v1.57.2
Signed-off-by: Vince Prignano <[email protected]>
1 parent a2a90a8 commit 37ee9f6

File tree

4 files changed

+16
-22
lines changed

4 files changed

+16
-22
lines changed

Diff for: .github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
- name: Set up Go
2727
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # tag=v5.0.0
2828
with:
29-
go-version: '1.22'
29+
go-version: "1.22"
3030
cache: false
3131
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag=v4.1.2
3232
- name: golangci-lint
3333
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # tag=v4.0.0
3434
with:
35-
version: v1.56.2
35+
version: v1.57.2
3636
args: --out-format=colored-line-number
3737
working-directory: ${{matrix.working-directory}}

Diff for: .golangci.yml

+9-7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ linters:
4141
- whitespace
4242

4343
linters-settings:
44+
govet:
45+
enable-all: true
46+
disable:
47+
- fieldalignment
48+
- shadow
4449
importas:
4550
no-unaliased: true
4651
alias:
@@ -58,10 +63,6 @@ linters-settings:
5863
# Controller Runtime
5964
- pkg: sigs.k8s.io/controller-runtime
6065
alias: ctrl
61-
staticcheck:
62-
go: "1.22"
63-
stylecheck:
64-
go: "1.22"
6566
revive:
6667
rules:
6768
# The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
@@ -105,6 +106,9 @@ issues:
105106
- Subprocess launch(ed with variable|ing should be audited)
106107
- (G204|G104|G307)
107108
- "ST1000: at least one file in a package should have a package comment"
109+
exclude-files:
110+
- "zz_generated.*\\.go$"
111+
- ".*conversion.*\\.go$"
108112
exclude-rules:
109113
- linters:
110114
- gosec
@@ -163,8 +167,6 @@ issues:
163167
path: _test\.go
164168

165169
run:
170+
go: "1.22"
166171
timeout: 10m
167-
skip-files:
168-
- "zz_generated.*\\.go$"
169-
- ".*conversion.*\\.go$"
170172
allow-parallel-runners: true

Diff for: pkg/manager/internal.go

+4-12
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,7 @@ func (cm *controllerManager) Start(ctx context.Context) (err error) {
389389
// WARNING: Internal HTTP servers MUST start before any cache is populated, otherwise it would block
390390
// conversion webhooks to be ready for serving which make the cache never get ready.
391391
if err := cm.runnables.HTTPServers.Start(cm.internalCtx); err != nil {
392-
if err != nil {
393-
return fmt.Errorf("failed to start HTTP servers: %w", err)
394-
}
392+
return fmt.Errorf("failed to start HTTP servers: %w", err)
395393
}
396394

397395
// Start any webhook servers, which includes conversion, validation, and defaulting
@@ -401,23 +399,17 @@ func (cm *controllerManager) Start(ctx context.Context) (err error) {
401399
// between conversion webhooks and the cache sync (usually initial list) which causes the webhooks
402400
// to never start because no cache can be populated.
403401
if err := cm.runnables.Webhooks.Start(cm.internalCtx); err != nil {
404-
if err != nil {
405-
return fmt.Errorf("failed to start webhooks: %w", err)
406-
}
402+
return fmt.Errorf("failed to start webhooks: %w", err)
407403
}
408404

409405
// Start and wait for caches.
410406
if err := cm.runnables.Caches.Start(cm.internalCtx); err != nil {
411-
if err != nil {
412-
return fmt.Errorf("failed to start caches: %w", err)
413-
}
407+
return fmt.Errorf("failed to start caches: %w", err)
414408
}
415409

416410
// Start the non-leaderelection Runnables after the cache has synced.
417411
if err := cm.runnables.Others.Start(cm.internalCtx); err != nil {
418-
if err != nil {
419-
return fmt.Errorf("failed to start other runnables: %w", err)
420-
}
412+
return fmt.Errorf("failed to start other runnables: %w", err)
421413
}
422414

423415
// Start the leader election and all required runnables.

Diff for: tools/setup-envtest/store/store.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (s *Store) Add(ctx context.Context, item Item, contents io.Reader) (resErr
182182
return err
183183
}
184184
}
185-
if err != nil && !errors.Is(err, io.EOF) {
185+
if err != nil && !errors.Is(err, io.EOF) { //nolintL:govet
186186
return fmt.Errorf("unable to finish un-tar-ing the downloaded archive: %w", err)
187187
}
188188
log.V(1).Info("unpacked archive")

0 commit comments

Comments
 (0)