Skip to content

Commit 658a670

Browse files
authored
Merge branch 'master' into feat/testifylint
2 parents d391908 + 41bfce9 commit 658a670

File tree

7 files changed

+31
-23
lines changed

7 files changed

+31
-23
lines changed

.github/workflows/tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: git fetch --prune --unshallow
2222

2323
- name: Create release
24-
uses: goreleaser/goreleaser-action@v4
24+
uses: goreleaser/goreleaser-action@v5
2525
with:
2626
version: latest
2727
args: release --clean

.pre-commit-hooks.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
- id: golangci-lint
22
name: golangci-lint
3-
description: Fast linters runner for Go.
3+
description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected.
44
entry: golangci-lint run --new-from-rev HEAD --fix
55
types: [go]
66
language: golang
77
require_serial: true
88
pass_filenames: false
9+
- id: golangci-lint-full
10+
name: golangci-lint-full
11+
description: Fast linters runner for Go. Runs on all files in the repo. Use this hook if you use pre-commit in CI.
12+
entry: golangci-lint run --fix
13+
types: [go]
14+
language: golang
15+
require_serial: true
16+
pass_filenames: false

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ require (
7979
github.com/nishanths/exhaustive v0.11.0
8080
github.com/nishanths/predeclared v0.2.2
8181
github.com/nunnatsa/ginkgolinter v0.13.5
82-
github.com/polyfloyd/go-errorlint v1.4.4
82+
github.com/polyfloyd/go-errorlint v1.4.5
8383
github.com/quasilyte/go-ruleguard/dsl v0.3.22
8484
github.com/ryancurrah/gomodguard v1.3.0
85-
github.com/ryanrolds/sqlclosecheck v0.4.0
85+
github.com/ryanrolds/sqlclosecheck v0.5.1
8686
github.com/sanposhiho/wastedassign/v2 v2.0.7
8787
github.com/sashamelentyev/interfacebloat v1.1.0
8888
github.com/sashamelentyev/usestdlibvars v1.24.0
@@ -102,7 +102,7 @@ require (
102102
github.com/stbenjam/no-sprintf-host-port v0.1.1
103103
github.com/stretchr/testify v1.8.4
104104
github.com/tdakkota/asciicheck v0.2.0
105-
github.com/tetafro/godot v1.4.14
105+
github.com/tetafro/godot v1.4.15
106106
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966
107107
github.com/timonwong/loggercheck v0.9.4
108108
github.com/tomarrell/wrapcheck/v2 v2.8.1
@@ -120,7 +120,7 @@ require (
120120
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
121121
golang.org/x/tools v0.13.0
122122
gopkg.in/yaml.v3 v3.0.1
123-
honnef.co/go/tools v0.4.5
123+
honnef.co/go/tools v0.4.6
124124
mvdan.cc/gofumpt v0.5.0
125125
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
126126
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d

go.sum

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

scripts/gen_github_action_config/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.19
44

55
require (
66
github.com/shurcooL/githubv4 v0.0.0-20230215024106-420ad0987b9b
7-
golang.org/x/oauth2 v0.11.0
7+
golang.org/x/oauth2 v0.12.0
88
)
99

1010
require (
1111
github.com/golang/protobuf v1.5.3 // indirect
1212
github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect
13-
golang.org/x/net v0.14.0 // indirect
13+
golang.org/x/net v0.15.0 // indirect
1414
google.golang.org/appengine v1.6.7 // indirect
1515
google.golang.org/protobuf v1.31.0 // indirect
1616
)

scripts/gen_github_action_config/go.sum

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

test/testdata/sqlclosecheck.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func rowsCorrectDefer() {
6868
}
6969

7070
func rowsMissingClose() {
71-
rows, err := db.QueryContext(ctx, "SELECT name FROM users WHERE age=?", age) // want "Rows/Stmt was not closed"
71+
rows, err := db.QueryContext(ctx, "SELECT name FROM users WHERE age=?", age) // want "Rows/Stmt/NamedStmt was not closed"
7272
if err != nil {
7373
log.Fatal(err)
7474
}
@@ -91,7 +91,7 @@ func rowsMissingClose() {
9191
}
9292

9393
func rowsMissingCloseG[T ~int64](db *sql.DB, a T) {
94-
rows, _ := db.Query("select id from tb") // want "Rows/Stmt was not closed"
94+
rows, _ := db.Query("select id from tb") // want "Rows/Stmt/NamedStmt was not closed"
9595
for rows.Next() {
9696
// ...
9797
}
@@ -208,7 +208,7 @@ func stmtCorrectDefer() {
208208

209209
func stmtMissingClose() {
210210
// In normal use, create one Stmt when your process starts.
211-
stmt, err := db.PrepareContext(ctx, "SELECT username FROM users WHERE id = ?") // want "Rows/Stmt was not closed"
211+
stmt, err := db.PrepareContext(ctx, "SELECT username FROM users WHERE id = ?") // want "Rows/Stmt/NamedStmt was not closed"
212212
if err != nil {
213213
log.Fatal(err)
214214
}

0 commit comments

Comments
 (0)