From b12fe1707cf881f845bb8a8b95a7deac5e2bf6f0 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 9 Apr 2014 15:47:42 -0400 Subject: [PATCH] go.tools/go/loader: slashify the name of packages found by walking the file tree. Otherwise on Windows the enumerated package "net\\http" will be distinct from the imported package "net/http" leading to strange errors. (A similar bug was fixed in go/ssa/stdlib_test.go.) Fixes golang/go#7189 LGTM=gri R=gri CC=golang-codereviews https://golang.org/cl/86170043 --- go/loader/stdlib_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/loader/stdlib_test.go b/go/loader/stdlib_test.go index 1fdecef8..e8d93637 100644 --- a/go/loader/stdlib_test.go +++ b/go/loader/stdlib_test.go @@ -35,7 +35,7 @@ func allPackages() []string { return filepath.SkipDir } if info.IsDir() { - pkg := strings.TrimPrefix(path, root) + pkg := filepath.ToSlash(strings.TrimPrefix(path, root)) switch pkg { case "builtin", "pkg": return filepath.SkipDir // skip these subtrees