Skip to content

Commit aa924dd

Browse files
committed
add golangci-lint
1 parent 462a862 commit aa924dd

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
jobs:
1515
test:
16+
name: Tests
1617
runs-on: ubuntu-latest
1718
strategy:
1819
fail-fast: true
@@ -22,12 +23,17 @@ jobs:
2223
- "1.24"
2324
steps:
2425
- name: Checkout
25-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2627

2728
- name: Install Go ${{ matrix.go }}
28-
uses: actions/setup-go@v5
29+
uses: actions/setup-go@v6
2930
with:
3031
go-version: ${{ matrix.go }}
3132

33+
- name: golangci-lint
34+
uses: golangci/golangci-lint-action@v9
35+
with:
36+
version: v2.11
37+
3238
- name: Run tests
3339
run: make

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ vet:
1313
test:
1414
go test ./...
1515

16+
.PHONY: lint
17+
lint:
18+
golangci-lint run
19+
1620
.PHONY: build
1721
build:
1822
go build -o bin/clickhouse-go-linter .

passes/chbatchclose/chbatchclose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (b *batchUsage) report(varName string, pass *analysis.Pass) {
6464
// no usage of rows.Next()
6565
return
6666
}
67-
if !(b.deferredClose || b.returned) {
67+
if !b.deferredClose && !b.returned {
6868
pass.Reportf(b.assignPos,
6969
"clickhouse Batch %s must be closed defensively with defer %s.Close() after successful instantiation",
7070
varName, varName)

0 commit comments

Comments
 (0)