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:
parent
7f24a8300e
commit
b12fe1707c
|
@ -35,7 +35,7 @@ func allPackages() []string {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
pkg := strings.TrimPrefix(path, root)
|
pkg := filepath.ToSlash(strings.TrimPrefix(path, root))
|
||||||
switch pkg {
|
switch pkg {
|
||||||
case "builtin", "pkg":
|
case "builtin", "pkg":
|
||||||
return filepath.SkipDir // skip these subtrees
|
return filepath.SkipDir // skip these subtrees
|
||||||
|
|
Loading…
Reference in New Issue