@@ -5,33 +5,31 @@ import (
55 "strings"
66 "sync"
77
8+ "github.com/OpenPeeDeeP/depguard"
89 "golang.org/x/tools/go/analysis"
910 "golang.org/x/tools/go/loader"
1011
1112 "github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
12-
13- depguardAPI "github.com/OpenPeeDeeP/depguard"
14-
1513 "github.com/golangci/golangci-lint/pkg/lint/linter"
1614 "github.com/golangci/golangci-lint/pkg/result"
1715)
1816
19- func setDepguardListType (dg * depguardAPI .Depguard , lintCtx * linter.Context ) error {
17+ func setDepguardListType (dg * depguard .Depguard , lintCtx * linter.Context ) error {
2018 listType := lintCtx .Settings ().Depguard .ListType
2119 var found bool
22- dg .ListType , found = depguardAPI .StringToListType [strings .ToLower (listType )]
20+ dg .ListType , found = depguard .StringToListType [strings .ToLower (listType )]
2321 if ! found {
2422 if listType != "" {
2523 return fmt .Errorf ("unsure what list type %s is" , listType )
2624 }
27- dg .ListType = depguardAPI .LTBlacklist
25+ dg .ListType = depguard .LTBlacklist
2826 }
2927
3028 return nil
3129}
3230
33- func setupDepguardPackages (dg * depguardAPI .Depguard , lintCtx * linter.Context ) {
34- if dg .ListType == depguardAPI .LTBlacklist {
31+ func setupDepguardPackages (dg * depguard .Depguard , lintCtx * linter.Context ) {
32+ if dg .ListType == depguard .LTBlacklist {
3533 // if the list type was a blacklist the packages with error messages should
3634 // be included in the blacklist package list
3735
@@ -66,7 +64,7 @@ func NewDepguard() *goanalysis.Linter {
6664 dgSettings := & lintCtx .Settings ().Depguard
6765 analyzer .Run = func (pass * analysis.Pass ) (interface {}, error ) {
6866 prog := goanalysis .MakeFakeLoaderProgram (pass )
69- dg := & depguardAPI .Depguard {
67+ dg := & depguard .Depguard {
7068 Packages : dgSettings .Packages ,
7169 IncludeGoRoot : dgSettings .IncludeGoRoot ,
7270 }
@@ -87,7 +85,7 @@ func NewDepguard() *goanalysis.Linter {
8785 return nil , nil
8886 }
8987 msgSuffix := "is in the blacklist"
90- if dg .ListType == depguardAPI .LTWhitelist {
88+ if dg .ListType == depguard .LTWhitelist {
9189 msgSuffix = "is not in the whitelist"
9290 }
9391 res := make ([]result.Issue , 0 , len (issues ))
0 commit comments