From a2450a5281a1fbbb767f18cb7389c8e99da41a3b Mon Sep 17 00:00:00 2001 From: Will Dixon Date: Mon, 6 Aug 2018 10:29:21 -0400 Subject: [PATCH] Path Prefix was broken on depguard --- Gopkg.lock | 4 ++-- vendor/github.com/OpenPeeDeeP/depguard/depguard.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index f559547c..c70303c3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -15,11 +15,11 @@ [[projects]] branch = "master" - digest = "1:9b379466c4eeb7e3beaabcad5d4d4899ac59953dd810fdfb4d938d011a2a7884" + digest = "1:da6b9c16fb5e97523f153981486c7541cf36543be2f246e258973d8e58a801dc" name = "github.com/OpenPeeDeeP/depguard" packages = ["."] pruneopts = "UT" - revision = "cd4e93412667442f1cfc61397f938427a12f65c1" + revision = "a69c782687b207067fa0e371408bb18f38e1355f" [[projects]] digest = "1:e92f5581902c345eb4ceffdcd4a854fb8f73cf436d47d837d1ec98ef1fe0a214" diff --git a/vendor/github.com/OpenPeeDeeP/depguard/depguard.go b/vendor/github.com/OpenPeeDeeP/depguard/depguard.go index a67d7782..433cf8ff 100644 --- a/vendor/github.com/OpenPeeDeeP/depguard/depguard.go +++ b/vendor/github.com/OpenPeeDeeP/depguard/depguard.go @@ -153,15 +153,15 @@ func (dg *Depguard) pkgInList(pkg string) bool { func (dg *Depguard) pkgInPrefixList(pkg string) bool { //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. - idx := sort.Search(len(dg.Packages), func(i int) bool { - return dg.Packages[i] > pkg + idx := sort.Search(len(dg.prefixPackages), func(i int) bool { + return dg.prefixPackages[i] > pkg }) - 1 //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 if idx == -1 { return false } - return strings.HasPrefix(pkg, dg.Packages[idx]) + return strings.HasPrefix(pkg, dg.prefixPackages[idx]) } func (dg *Depguard) pkgInGlobList(pkg string) bool {