From: Russ Cox Date: Thu, 14 Jan 2016 19:40:54 +0000 (-0500) Subject: cmd/go: fix vendor directory check on Windows X-Git-Tag: go1.6rc1~108 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=383d817e02384d9504fb4fb661291df9a64ebcce;p=gostls13.git cmd/go: fix vendor directory check on Windows Fixes build. Change-Id: Idd7d87f0bf3fe553b3ab00dd32eee4925a4fe3ff Reviewed-on: https://go-review.googlesource.com/18647 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index b00896d938..0507841c6b 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -516,7 +516,7 @@ func disallowInternal(srcDir string, p *Package, stk *importStack) *Package { i-- // rewind over slash in ".../internal" } parent := p.Dir[:i+len(p.Dir)-len(p.ImportPath)] - if hasPathPrefix(filepath.ToSlash(srcDir), filepath.ToSlash(parent)) { + if hasFilePathPrefix(filepath.Clean(srcDir), filepath.Clean(parent)) { return p } @@ -613,7 +613,7 @@ func disallowVendorVisibility(srcDir string, p *Package, stk *importStack) *Pack return p } parent := p.Dir[:truncateTo] - if hasPathPrefix(filepath.ToSlash(srcDir), filepath.ToSlash(parent)) { + if hasFilePathPrefix(filepath.Clean(srcDir), filepath.Clean(parent)) { return p }