Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump honnef.co/go/tools from v0.1.4 to v0.2.0 #2019

Merged
merged 1 commit into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ require (
github.com/yeya24/promlinter v0.1.0
golang.org/x/tools v0.1.2-0.20210512205948-8287d5da45e4
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
honnef.co/go/tools v0.1.4
honnef.co/go/tools v0.2.0
mvdan.cc/gofumpt v0.1.1
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions pkg/golinters/staticcheck_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"unicode"

"golang.org/x/tools/go/analysis"
"honnef.co/go/tools/analysis/lint"
scconfig "honnef.co/go/tools/config"

"github.com/golangci/golangci-lint/pkg/config"
Expand All @@ -27,19 +28,19 @@ func getGoVersion(settings *config.StaticCheckSettings) string {
return "1.13"
}

func setupStaticCheckAnalyzers(src map[string]*analysis.Analyzer, goVersion string, checks []string) []*analysis.Analyzer {
func setupStaticCheckAnalyzers(src []*lint.Analyzer, goVersion string, checks []string) []*analysis.Analyzer {
var names []string
for name := range src {
names = append(names, name)
for _, a := range src {
names = append(names, a.Analyzer.Name)
}

filter := filterAnalyzerNames(names, checks)

var ret []*analysis.Analyzer
for name, a := range src {
if filter[name] {
setAnalyzerGoVersion(a, goVersion)
ret = append(ret, a)
for _, a := range src {
if filter[a.Analyzer.Name] {
setAnalyzerGoVersion(a.Analyzer, goVersion)
ret = append(ret, a.Analyzer)
}
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/golinters/unused.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func NewUnused(settings *config.StaticCheckSettings) *goanalysis.Linter {

analyzer := &analysis.Analyzer{
Name: name,
Doc: unused.Analyzer.Doc,
Requires: unused.Analyzer.Requires,
Doc: unused.Analyzer.Analyzer.Doc,
Requires: unused.Analyzer.Analyzer.Requires,
Run: func(pass *analysis.Pass) (interface{}, error) {
res, err := unused.Analyzer.Run(pass)
res, err := unused.Analyzer.Analyzer.Run(pass)
if err != nil {
return nil, err
}
Expand Down