Skip to content

Commit a063546

Browse files
authored
chore: Update golangci-lint version and add some new linters (#509)
Co-authored-by: jb-abbadie <[email protected]>
1 parent df68854 commit a063546

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.github/workflows/golangci-lint.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ jobs:
2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v6
2525
with:
26-
version: v1.57.2
27-
26+
version: v1.63.4

.golangci.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ run:
44

55
linters:
66
enable:
7+
- asasalint
78
- asciicheck
89
- bidichk
910
- bodyclose
10-
- deadcode
11+
- containedctx
12+
- copyloopvar
13+
- cyclop
14+
- decorder
1115
- dogsled
1216
- dupl
17+
- dupword
1318
- durationcheck
1419
- errcheck
20+
- errchkjson
1521
- errname
1622
- errorlint
17-
- exportloopref
23+
- exhaustive
24+
- exptostd
25+
- forcetypeassert
26+
- fatcontext
1827
- gochecknoinits
1928
- goconst
2029
- gocritic
@@ -25,38 +34,31 @@ linters:
2534
- gomoddirectives
2635
- gomodguard
2736
- goprintffuncname
37+
- gosec
2838
- gosimple
39+
- govet
2940
- importas
41+
- ineffassign
3042
- makezero
3143
- misspell
3244
- nakedret
45+
- nilerr
3346
- predeclared
3447
- promlinter
3548
- rowserrcheck
3649
- sqlclosecheck
37-
- structcheck
3850
- testpackage
3951
- thelper
4052
- tparallel
4153
- typecheck
4254
- unused
43-
- varcheck
44-
- whitespace
45-
- gosec
46-
- forcetypeassert
47-
- cyclop
48-
- exhaustive
49-
- govet
50-
- nilerr
5155
- wastedassign
52-
- ineffassign
56+
- whitespace
5357
disable:
5458
# Should be readded in the future with a dedicated PR to do the fix
55-
- depguard
5659
- funlen
5760
- gocognit
5861
- gofumpt
59-
- ifshort
6062
- nestif
6163
- nolintlint
6264
- revive
@@ -66,8 +68,13 @@ linters:
6668
- unparam
6769

6870
# Disabled with a reason
71+
- canonicalheader # Clickhouse uses non-canonical header
72+
- depguard # Way too spammy and forces whitelist of all imports
6973
- gochecknoglobals # incompatible with the way we define our flags currently
70-
- maligned # checker not supported anymore
7174
- noctx # disabled because we do not plan to distribute this code as a library
7275
- prealloc # we are not after some perf
7376
- tagliatelle # disabled because we are dependant on external API that do not follow the right naming
77+
linters-settings:
78+
gosec:
79+
excludes:
80+
- G115 # Unsafe cast of ints. Needs to be looked at by a dedicated PR

proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (rp *reverseProxy) serveFromCache(s *scope, srw *statResponseWriter, req *h
408408
log.Debugf("%s: cache miss after awaiting concurrent query", s)
409409
}
410410
} else if transactionStatus.State.IsFailed() {
411-
respondWith(srw, fmt.Errorf(transactionStatus.FailReason), http.StatusInternalServerError)
411+
respondWith(srw, fmt.Errorf("%v", transactionStatus.FailReason), http.StatusInternalServerError)
412412
return
413413
}
414414
}

0 commit comments

Comments
 (0)