From b2bca04de1698d074dc541b35b1f06a80bb6337e Mon Sep 17 00:00:00 2001 From: lufeee Date: Wed, 23 Mar 2022 00:43:19 +0900 Subject: [PATCH 01/12] Add execinquery --- go.mod | 1 + go.sum | 2 ++ pkg/golinters/querycheck.go | 19 +++++++++++++++++++ pkg/lint/lintersdb/manager.go | 5 +++++ test/testdata/querycheck.go | 12 ++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 pkg/golinters/querycheck.go create mode 100644 test/testdata/querycheck.go diff --git a/go.mod b/go.mod index ce43755923b7..af6cb4193d42 100644 --- a/go.mod +++ b/go.mod @@ -170,5 +170,6 @@ require github.com/hashicorp/go-version v1.4.0 require ( github.com/hexops/gotextdiff v1.0.3 // indirect + github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect ) diff --git a/go.sum b/go.sum index 7bd7dc6f393e..bd72f27f5d73 100644 --- a/go.sum +++ b/go.sum @@ -461,6 +461,8 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e h1:Xyyvai6ZhbEic6gXjFZmYREr0P+n2NDrzop/axo8XCg= +github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= diff --git a/pkg/golinters/querycheck.go b/pkg/golinters/querycheck.go new file mode 100644 index 000000000000..207a9a0da091 --- /dev/null +++ b/pkg/golinters/querycheck.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "github.com/lufeee/execinquery" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewExecinQuery() *goanalysis.Linter { + a := execinquery.Analyzer + + return goanalysis.NewLinter( + a.Name, + a.Doc, + []*analysis.Analyzer{a}, + nil, + ).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index b64ba23e4ed7..b55ca8007966 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -689,6 +689,11 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.26.0"). WithPresets(linter.PresetStyle). WithURL("https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md"), + + linter.NewConfig(golinters.NewExecinQuery()). + WithSince("1.0.0"). + WithPresets(linter.PresetStyle). + WithURL("https://github.com/lufeee/execinquery"), } enabledByDefault := map[string]bool{ diff --git a/test/testdata/querycheck.go b/test/testdata/querycheck.go new file mode 100644 index 000000000000..76bc6d64daa1 --- /dev/null +++ b/test/testdata/querycheck.go @@ -0,0 +1,12 @@ +package testdata + +import ( + "database/sql" +) + +func main() { + db, _ := sql.Open("mysql", "test:test@tcp(test:3306)/test") + + test := "a" + _, err = db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" +} From c37041f97c9cf1b13868cacc43a69e8800166fb1 Mon Sep 17 00:00:00 2001 From: lufeee Date: Wed, 23 Mar 2022 10:01:39 +0900 Subject: [PATCH 02/12] Add more test case and change version --- pkg/lint/lintersdb/manager.go | 2 +- test/testdata/querycheck.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index b55ca8007966..32859edf752b 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -691,7 +691,7 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithURL("https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md"), linter.NewConfig(golinters.NewExecinQuery()). - WithSince("1.0.0"). + WithSince("v1.46.0"). WithPresets(linter.PresetStyle). WithURL("https://github.com/lufeee/execinquery"), } diff --git a/test/testdata/querycheck.go b/test/testdata/querycheck.go index 76bc6d64daa1..3093a95e7c97 100644 --- a/test/testdata/querycheck.go +++ b/test/testdata/querycheck.go @@ -8,5 +8,8 @@ func main() { db, _ := sql.Open("mysql", "test:test@tcp(test:3306)/test") test := "a" - _, err = db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, err = db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, err = db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, err = db.QueryContext("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, err = db.QueryRowContext("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" } From eba848ccdccff0a8ea06cb09c9633f58eef1bb38 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 03:42:44 +0200 Subject: [PATCH 03/12] review: fix go mod --- go.mod | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index af6cb4193d42..729fca59b65d 100644 --- a/go.mod +++ b/go.mod @@ -40,6 +40,7 @@ require ( github.com/gostaticanalysis/forcetypeassert v0.1.0 github.com/gostaticanalysis/nilerr v0.1.1 github.com/hashicorp/go-multierror v1.1.1 + github.com/hashicorp/go-version v1.4.0 github.com/jgautheron/goconst v1.5.1 github.com/jingyugao/rowserrcheck v1.1.1 github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af @@ -51,6 +52,7 @@ require ( github.com/ldez/gomoddirectives v0.2.2 github.com/ldez/tagliatelle v0.3.1 github.com/leonklingele/grouper v1.1.0 + github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e github.com/maratori/testpackage v1.0.1 github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0 github.com/mattn/go-colorable v0.1.12 @@ -126,6 +128,7 @@ require ( github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect @@ -157,6 +160,7 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect @@ -165,11 +169,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect ) - -require github.com/hashicorp/go-version v1.4.0 - -require ( - github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect -) From 2cb86de3f9f37501e6bac59aa535c57e988d9a4c Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 03:46:58 +0200 Subject: [PATCH 04/12] review: preset and alphabetical order --- pkg/golinters/querycheck.go | 2 +- pkg/lint/lintersdb/manager.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/golinters/querycheck.go b/pkg/golinters/querycheck.go index 207a9a0da091..11cf025e33fe 100644 --- a/pkg/golinters/querycheck.go +++ b/pkg/golinters/querycheck.go @@ -7,7 +7,7 @@ import ( "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) -func NewExecinQuery() *goanalysis.Linter { +func NewExecInQuery() *goanalysis.Linter { a := execinquery.Analyzer return goanalysis.NewLinter( diff --git a/pkg/lint/lintersdb/manager.go b/pkg/lint/lintersdb/manager.go index 32859edf752b..6178e0bec2c7 100644 --- a/pkg/lint/lintersdb/manager.go +++ b/pkg/lint/lintersdb/manager.go @@ -266,6 +266,11 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithLoadForGoAnalysis(). WithURL("https://github.com/polyfloyd/go-errorlint"), + linter.NewConfig(golinters.NewExecInQuery()). + WithSince("v1.46.0"). + WithPresets(linter.PresetSQL). + WithURL("https://github.com/lufeee/execinquery"), + linter.NewConfig(golinters.NewExhaustive(exhaustiveCfg)). WithSince(" v1.28.0"). WithPresets(linter.PresetBugs). @@ -689,11 +694,6 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { WithSince("v1.26.0"). WithPresets(linter.PresetStyle). WithURL("https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint/README.md"), - - linter.NewConfig(golinters.NewExecinQuery()). - WithSince("v1.46.0"). - WithPresets(linter.PresetStyle). - WithURL("https://github.com/lufeee/execinquery"), } enabledByDefault := map[string]bool{ From 23575d99881bba23278e6c288bc22754a7b36f97 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 04:01:31 +0200 Subject: [PATCH 05/12] review: rename files and fix tests --- .../{querycheck.go => execinquery.go} | 0 test/testdata/execinquery.go | 34 +++++++++++++++++++ test/testdata/querycheck.go | 15 -------- 3 files changed, 34 insertions(+), 15 deletions(-) rename pkg/golinters/{querycheck.go => execinquery.go} (100%) create mode 100644 test/testdata/execinquery.go delete mode 100644 test/testdata/querycheck.go diff --git a/pkg/golinters/querycheck.go b/pkg/golinters/execinquery.go similarity index 100% rename from pkg/golinters/querycheck.go rename to pkg/golinters/execinquery.go diff --git a/test/testdata/execinquery.go b/test/testdata/execinquery.go new file mode 100644 index 000000000000..61c92186d29e --- /dev/null +++ b/test/testdata/execinquery.go @@ -0,0 +1,34 @@ +//args: -Eexecinquery +package testdata + +import ( + "database/sql" + + "golang.org/x/net/context" +) + +func execinquery() { + db, _ := sql.Open("mysql", "test:test@tcp(test:3306)/test") + + test := "a" + + _, err := db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + if err != nil { + return + } + + db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + if err != nil { + return + } + + ctx := context.Background() + + _, err = db.QueryContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + if err != nil { + return + } + + db.QueryRowContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + +} diff --git a/test/testdata/querycheck.go b/test/testdata/querycheck.go deleted file mode 100644 index 3093a95e7c97..000000000000 --- a/test/testdata/querycheck.go +++ /dev/null @@ -1,15 +0,0 @@ -package testdata - -import ( - "database/sql" -) - -func main() { - db, _ := sql.Open("mysql", "test:test@tcp(test:3306)/test") - - test := "a" - _, err = db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" - _, err = db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" - _, err = db.QueryContext("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" - _, err = db.QueryRowContext("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" -} From 73ef64f0b1bdacf09ffc9d9b1e469360d35cbfa6 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 04:13:12 +0200 Subject: [PATCH 06/12] review: fix analyzer --- pkg/golinters/execinquery.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/golinters/execinquery.go b/pkg/golinters/execinquery.go index 11cf025e33fe..87f801bc4ee3 100644 --- a/pkg/golinters/execinquery.go +++ b/pkg/golinters/execinquery.go @@ -11,7 +11,7 @@ func NewExecInQuery() *goanalysis.Linter { a := execinquery.Analyzer return goanalysis.NewLinter( - a.Name, + "execinquery", a.Doc, []*analysis.Analyzer{a}, nil, From eef9f55a7116e755b584192d7a9c96ff4d31de51 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 04:49:24 +0200 Subject: [PATCH 07/12] review: fix tests --- pkg/golinters/execinquery.go | 8 +++++--- test/testdata/execinquery.go | 18 +++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/pkg/golinters/execinquery.go b/pkg/golinters/execinquery.go index 87f801bc4ee3..5bd1caf503a1 100644 --- a/pkg/golinters/execinquery.go +++ b/pkg/golinters/execinquery.go @@ -1,17 +1,19 @@ package golinters import ( + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/lufeee/execinquery" "golang.org/x/tools/go/analysis" - - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) func NewExecInQuery() *goanalysis.Linter { + const linterName = "execinquery" + a := execinquery.Analyzer + a.Name = linterName // TODO the name must change inside the linter. return goanalysis.NewLinter( - "execinquery", + linterName, a.Doc, []*analysis.Analyzer{a}, nil, diff --git a/test/testdata/execinquery.go b/test/testdata/execinquery.go index 61c92186d29e..3b84d54fa539 100644 --- a/test/testdata/execinquery.go +++ b/test/testdata/execinquery.go @@ -1,34 +1,30 @@ -//args: -Eexecinquery +// args: -Eexecinquery package testdata import ( + "context" "database/sql" - - "golang.org/x/net/context" ) -func execinquery() { - db, _ := sql.Open("mysql", "test:test@tcp(test:3306)/test") - +func execInQuery(db *sql.DB) { test := "a" - _, err := db.Query("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, 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" if err != nil { return } - db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + db.QueryRow("Update * FROM hoge where id = ?", test) // ERROR "It's better to use Execute method instead of QueryRow method to execute `UPDATE` query" if err != nil { return } ctx := context.Background() - _, err = db.QueryContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" + _, 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 " if err != nil { return } - db.QueryRowContext(ctx, "Update * FROM hoge where id = ?", test) // ERROR "Query not `SELECT` query" - + 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" } From 4f0673a916f2afdc7fa44714d9636da98c64dc1a Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 04:51:35 +0200 Subject: [PATCH 08/12] review: fix imports --- pkg/golinters/execinquery.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/golinters/execinquery.go b/pkg/golinters/execinquery.go index 5bd1caf503a1..0428db1c0ce9 100644 --- a/pkg/golinters/execinquery.go +++ b/pkg/golinters/execinquery.go @@ -1,9 +1,10 @@ package golinters import ( - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/lufeee/execinquery" "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) func NewExecInQuery() *goanalysis.Linter { From 86ad25f346ea399d40dfdb935c0da936e4bda268 Mon Sep 17 00:00:00 2001 From: lufeee Date: Tue, 29 Mar 2022 16:58:10 +0900 Subject: [PATCH 09/12] update go.mod --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 729fca59b65d..1b5d22d051a7 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,6 @@ require ( github.com/ldez/gomoddirectives v0.2.2 github.com/ldez/tagliatelle v0.3.1 github.com/leonklingele/grouper v1.1.0 - github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e github.com/maratori/testpackage v1.0.1 github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0 github.com/mattn/go-colorable v0.1.12 @@ -131,6 +130,7 @@ require ( github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect + github.com/lufeee/execinquery v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-isatty v0.0.14 // indirect diff --git a/go.sum b/go.sum index bd72f27f5d73..1bff9618f57c 100644 --- a/go.sum +++ b/go.sum @@ -463,6 +463,8 @@ github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e h1:Xyyvai6ZhbEic6gXjFZmYREr0P+n2NDrzop/axo8XCg= github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/lufeee/execinquery v1.0.0 h1:1XUTuLIVPDlFvUU3LXmmZwHDsolsxXnY67lzhpeqe0I= +github.com/lufeee/execinquery v1.0.0/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= From 7e4a5d462c10f3aca6e4ad3d37456e15283f85f3 Mon Sep 17 00:00:00 2001 From: lufeee Date: Tue, 29 Mar 2022 17:00:46 +0900 Subject: [PATCH 10/12] delete previous version --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 1bff9618f57c..9ef4cfa52b22 100644 --- a/go.sum +++ b/go.sum @@ -461,8 +461,6 @@ github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e h1:Xyyvai6ZhbEic6gXjFZmYREr0P+n2NDrzop/axo8XCg= -github.com/lufeee/execinquery v0.0.0-20220322150457-8f5c1333d66e/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufeee/execinquery v1.0.0 h1:1XUTuLIVPDlFvUU3LXmmZwHDsolsxXnY67lzhpeqe0I= github.com/lufeee/execinquery v1.0.0/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= From 5bcdbea14d04fdc7c6ba4fe270550b2b6f36bc2b Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 10:01:19 +0200 Subject: [PATCH 11/12] review: fix go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1b5d22d051a7..8e1c87e63701 100644 --- a/go.mod +++ b/go.mod @@ -52,6 +52,7 @@ require ( github.com/ldez/gomoddirectives v0.2.2 github.com/ldez/tagliatelle v0.3.1 github.com/leonklingele/grouper v1.1.0 + github.com/lufeee/execinquery v1.0.0 github.com/maratori/testpackage v1.0.1 github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0 github.com/mattn/go-colorable v0.1.12 @@ -130,7 +131,6 @@ require ( github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kisielk/gotool v1.0.0 // indirect - github.com/lufeee/execinquery v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mattn/go-isatty v0.0.14 // indirect From f71c59590285b30393e5d163b5acfb27946cfe29 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Tue, 29 Mar 2022 11:02:39 +0200 Subject: [PATCH 12/12] review: remove temp fix --- pkg/golinters/execinquery.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/golinters/execinquery.go b/pkg/golinters/execinquery.go index 0428db1c0ce9..11cf025e33fe 100644 --- a/pkg/golinters/execinquery.go +++ b/pkg/golinters/execinquery.go @@ -8,13 +8,10 @@ import ( ) func NewExecInQuery() *goanalysis.Linter { - const linterName = "execinquery" - a := execinquery.Analyzer - a.Name = linterName // TODO the name must change inside the linter. return goanalysis.NewLinter( - linterName, + a.Name, a.Doc, []*analysis.Analyzer{a}, nil,