Skip to content

Commit

Permalink
build(deps): bump github.com/OpenPeeDeeP/depguard/v2 from v2.0.1 to 2…
Browse files Browse the repository at this point in the history
….1.0
  • Loading branch information
ldez committed Jun 3, 2023
1 parent 68be5ba commit 24aada0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/BurntSushi/toml v1.3.0
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0
github.com/OpenPeeDeeP/depguard/v2 v2.1.0
github.com/alexkohler/nakedret/v2 v2.0.1
github.com/alexkohler/prealloc v1.0.0
github.com/alingse/asasalint v0.0.11
Expand Down
2 changes: 2 additions & 0 deletions go.sum

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

14 changes: 6 additions & 8 deletions pkg/golinters/depguard.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package golinters

import (
"github.com/golangci/depguard/v2"
"github.com/OpenPeeDeeP/depguard/v2"
"golang.org/x/tools/go/analysis"

"github.com/golangci/golangci-lint/pkg/config"
Expand Down Expand Up @@ -33,19 +33,17 @@ func NewDepguard(settings *config.DepGuardSettings) *goanalysis.Linter {
}
}

a := depguard.NewCoreAnalyzer(depguard.CoreSettings{})
a := depguard.NewUncompiledAnalyzer(&conf)

return goanalysis.NewLinter(
a.Name,
a.Doc,
[]*analysis.Analyzer{a},
a.Analyzer.Name,
a.Analyzer.Doc,
[]*analysis.Analyzer{a.Analyzer},
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
coreSettings, err := conf.Compile()
err := a.Compile()
if err != nil {
lintCtx.Log.Errorf("create analyzer: %v", err)
}

a.Run = coreSettings.Run
}).WithLoadMode(goanalysis.LoadModeSyntax)
}

0 comments on commit 24aada0

Please sign in to comment.