go/loader: convert directory separators to slash when enumerating packages.

(On Windows the two are not the same.)

Fixes golang/go#7189.

Also: remove exception for code.google.com subtree; this was
an artifact of my unusual setup.

LGTM=gri
R=alex.brainman, gri
CC=golang-codereviews
https://golang.org/cl/70060048
This commit is contained in:
Alan Donovan 2014-03-04 13:48:09 -05:00
parent 53324e8992
commit 5536d2ae3e
1 changed files with 2 additions and 2 deletions

View File

@ -33,9 +33,9 @@ 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", "code.google.com": case "builtin", "pkg":
return filepath.SkipDir // skip these subtrees return filepath.SkipDir // skip these subtrees
case "": case "":
return nil // ignore root of tree return nil // ignore root of tree