Skip to content

Commit 044f0a1

Browse files
authored
bump github.com/lufeee/execinquery from v1.0.0 to v1.2.0 (#2845)
1 parent 59971a1 commit 044f0a1

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ require (
5454
github.com/ldez/gomoddirectives v0.2.3
5555
github.com/ldez/tagliatelle v0.3.1
5656
github.com/leonklingele/grouper v1.1.0
57-
github.com/lufeee/execinquery v1.0.0
57+
github.com/lufeee/execinquery v1.2.0
5858
github.com/maratori/testpackage v1.0.1
5959
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0
6060
github.com/mattn/go-colorable v0.1.12

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/execinquery.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ func NewExecInQuery() *goanalysis.Linter {
1515
a.Doc,
1616
[]*analysis.Analyzer{a},
1717
nil,
18-
).WithLoadMode(goanalysis.LoadModeSyntax)
18+
).WithLoadMode(goanalysis.LoadModeTypesInfo)
1919
}

pkg/lint/lintersdb/manager.go

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
271271
linter.NewConfig(golinters.NewExecInQuery()).
272272
WithSince("v1.46.0").
273273
WithPresets(linter.PresetSQL).
274+
WithLoadForGoAnalysis().
274275
WithURL("https://github.com/lufeee/execinquery"),
275276

276277
linter.NewConfig(golinters.NewExhaustive(exhaustiveCfg)).

test/testdata/execinquery.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ import (
99
func execInQuery(db *sql.DB) {
1010
test := "a"
1111

12-
_, err := db.Query("Update * FROM hoge where id = ?", test) // ERROR "It's better to use Execute method instead of Query method to execute `UPDATE` query"
12+
_, err := db.Query("Update * FROM hoge where id = ?", test) // ERROR "Use Exec instead of Query to execute `UPDATE` query"
1313
if err != nil {
1414
return
1515
}
1616

17-
db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "It's better to use Execute method instead of QueryRow method to execute `UPDATE` query"
17+
db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "Use Exec instead of QueryRow to execute `UPDATE` query"
1818
if err != nil {
1919
return
2020
}
2121

2222
ctx := context.Background()
2323

24-
_, err = db.QueryContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "It's better to use Execute method instead of QueryContext method to execute `UPDATE` query "
24+
_, err = db.QueryContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Use ExecContext instead of QueryContext to execute `UPDATE` query"
2525
if err != nil {
2626
return
2727
}
2828

29-
db.QueryRowContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "It's better to use Execute method instead of QueryRowContext method to execute `UPDATE` query"
29+
db.QueryRowContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Use ExecContext instead of QueryRowContext to execute `UPDATE` query"
3030
}

0 commit comments

Comments
 (0)