]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix vendor directory check on Windows
authorRuss Cox <rsc@golang.org>
Thu, 14 Jan 2016 19:40:54 +0000 (14:40 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 14 Jan 2016 20:41:14 +0000 (20:41 +0000)
Fixes build.

Change-Id: Idd7d87f0bf3fe553b3ab00dd32eee4925a4fe3ff
Reviewed-on: https://go-review.googlesource.com/18647
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/go/pkg.go

index b00896d938d47ad9f0f5eb8602f953ea34509c22..0507841c6b13b58503c99b36753fe2a2037e388f 100644 (file)
@@ -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
        }