1
0
mirror of https://github.com/golang/go synced 2024-11-18 17:54:57 -07:00

imports: avoid src/v and src/mod again

This time for real.

Change-Id: I480fd6e4aa591efaf8380e86f5447b8c2bc28cda
Reviewed-on: https://go-review.googlesource.com/122615
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Russ Cox 2018-07-09 11:50:51 -04:00 committed by Brad Fitzpatrick
parent e2be0f7276
commit ee8f72c720

View File

@ -643,6 +643,9 @@ func scanGoDirs(which goDirType) {
srcV := filepath.Join(srcDir, "v")
srcMod := filepath.Join(srcDir, "mod")
walkFn := func(path string, typ os.FileMode) error {
if path == srcV || path == srcMod {
return filepath.SkipDir
}
dir := filepath.Dir(path)
if typ.IsRegular() {
if dir == srcDir {
@ -650,9 +653,6 @@ func scanGoDirs(which goDirType) {
// directly in your $GOPATH/src or $GOROOT/src.
return nil
}
if dir == srcV || dir == srcMod {
return filepath.SkipDir
}
if !strings.HasSuffix(path, ".go") {
return nil
}