Path Prefix was broken on depguard
This commit is contained in:
parent
1f3d5b2e42
commit
a2450a5281
4
Gopkg.lock
generated
4
Gopkg.lock
generated
@ -15,11 +15,11 @@
|
|||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
digest = "1:9b379466c4eeb7e3beaabcad5d4d4899ac59953dd810fdfb4d938d011a2a7884"
|
digest = "1:da6b9c16fb5e97523f153981486c7541cf36543be2f246e258973d8e58a801dc"
|
||||||
name = "github.com/OpenPeeDeeP/depguard"
|
name = "github.com/OpenPeeDeeP/depguard"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "cd4e93412667442f1cfc61397f938427a12f65c1"
|
revision = "a69c782687b207067fa0e371408bb18f38e1355f"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214"
|
digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214"
|
||||||
|
6
vendor/github.com/OpenPeeDeeP/depguard/depguard.go
generated
vendored
6
vendor/github.com/OpenPeeDeeP/depguard/depguard.go
generated
vendored
@ -153,15 +153,15 @@ func (dg *Depguard) pkgInList(pkg string) bool {
|
|||||||
func (dg *Depguard) pkgInPrefixList(pkg string) bool {
|
func (dg *Depguard) pkgInPrefixList(pkg string) bool {
|
||||||
//Idx represents where in the package slice the passed in package would go
|
//Idx represents where in the package slice the passed in package would go
|
||||||
//when sorted. -1 Just means that it would be at the very front of the slice.
|
//when sorted. -1 Just means that it would be at the very front of the slice.
|
||||||
idx := sort.Search(len(dg.Packages), func(i int) bool {
|
idx := sort.Search(len(dg.prefixPackages), func(i int) bool {
|
||||||
return dg.Packages[i] > pkg
|
return dg.prefixPackages[i] > pkg
|
||||||
}) - 1
|
}) - 1
|
||||||
//This means that the package passed in has no way to be prefixed by anything
|
//This means that the package passed in has no way to be prefixed by anything
|
||||||
//in the package list as it is already smaller then everything
|
//in the package list as it is already smaller then everything
|
||||||
if idx == -1 {
|
if idx == -1 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return strings.HasPrefix(pkg, dg.Packages[idx])
|
return strings.HasPrefix(pkg, dg.prefixPackages[idx])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dg *Depguard) pkgInGlobList(pkg string) bool {
|
func (dg *Depguard) pkgInGlobList(pkg string) bool {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user