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
This commit is contained in:
Alan Donovan 2014-04-09 15:47:42 -04:00
parent 7f24a8300e
commit b12fe1707c
1 changed files with 1 additions and 1 deletions

View File

@ -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