aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/OpenPeeDeeP
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/OpenPeeDeeP')
-rw-r--r--vendor/github.com/OpenPeeDeeP/depguard/README.md2
-rw-r--r--vendor/github.com/OpenPeeDeeP/depguard/depguard.go12
-rw-r--r--vendor/github.com/OpenPeeDeeP/depguard/go.mod10
-rw-r--r--vendor/github.com/OpenPeeDeeP/depguard/go.sum16
4 files changed, 13 insertions, 27 deletions
diff --git a/vendor/github.com/OpenPeeDeeP/depguard/README.md b/vendor/github.com/OpenPeeDeeP/depguard/README.md
index b9422757d..07e9f915d 100644
--- a/vendor/github.com/OpenPeeDeeP/depguard/README.md
+++ b/vendor/github.com/OpenPeeDeeP/depguard/README.md
@@ -79,7 +79,7 @@ Like the `packages` field, the `ignoreFileRules` field can accept both string pr
## Gometalinter
The binary installation of this linter can be used with
-[Gometalinter](github.com/alecthomas/gometalinter).
+[Gometalinter](https://github.com/alecthomas/gometalinter).
If you use a configuration file for Gometalinter then the following will need to
be added to your configuration file.
diff --git a/vendor/github.com/OpenPeeDeeP/depguard/depguard.go b/vendor/github.com/OpenPeeDeeP/depguard/depguard.go
index b72754913..d7011cd9f 100644
--- a/vendor/github.com/OpenPeeDeeP/depguard/depguard.go
+++ b/vendor/github.com/OpenPeeDeeP/depguard/depguard.go
@@ -7,6 +7,7 @@ import (
"path"
"sort"
"strings"
+ "sync"
"github.com/gobwas/glob"
"golang.org/x/tools/go/loader"
@@ -61,6 +62,9 @@ type Depguard struct {
globIgnoreFileRules []negatableGlob
prefixRoot []string
+
+ isInitialized bool
+ isInitializedMutex sync.Mutex
}
// Run checks for dependencies given the program and validates them against
@@ -102,6 +106,13 @@ func (dg *Depguard) Run(config *loader.Config, prog *loader.Program) ([]*Issue,
}
func (dg *Depguard) initialize(config *loader.Config, prog *loader.Program) error {
+ dg.isInitializedMutex.Lock()
+ defer dg.isInitializedMutex.Unlock()
+
+ if dg.isInitialized {
+ return nil
+ }
+
// parse ordinary guarded packages
for _, pkg := range dg.Packages {
if strings.ContainsAny(pkg, "!?*[]{}") {
@@ -168,6 +179,7 @@ func (dg *Depguard) initialize(config *loader.Config, prog *loader.Program) erro
}
}
+ dg.isInitialized = true
return nil
}
diff --git a/vendor/github.com/OpenPeeDeeP/depguard/go.mod b/vendor/github.com/OpenPeeDeeP/depguard/go.mod
deleted file mode 100644
index 68daf00d7..000000000
--- a/vendor/github.com/OpenPeeDeeP/depguard/go.mod
+++ /dev/null
@@ -1,10 +0,0 @@
-module github.com/OpenPeeDeeP/depguard
-
-go 1.13
-
-require (
- github.com/gobwas/glob v0.2.3
- github.com/kisielk/gotool v1.0.0
- github.com/stretchr/testify v1.7.0 // indirect
- golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b
-)
diff --git a/vendor/github.com/OpenPeeDeeP/depguard/go.sum b/vendor/github.com/OpenPeeDeeP/depguard/go.sum
deleted file mode 100644
index 11a8c1c4a..000000000
--- a/vendor/github.com/OpenPeeDeeP/depguard/go.sum
+++ /dev/null
@@ -1,16 +0,0 @@
-github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
-github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
-github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
-github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b h1:7tibmaEqrQYA+q6ri7NQjuxqSwechjtDHKq6/e85S38=
-golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=