walkPkgs := func(root, importPathRoot string) {
root = filepath.Clean(root)
+ var cmd string
+ if root == cfg.GOROOTsrc {
+ cmd = filepath.Join(root, "cmd")
+ }
filepath.Walk(root, func(path string, fi os.FileInfo, err error) error {
if err != nil {
return nil
return nil
}
+ // GOROOT/src/cmd makes use of GOROOT/src/cmd/vendor,
+ // which module mode can't deal with. Eventually we'll stop using
+ // that vendor directory, and then we can remove this exclusion.
+ // golang.org/issue/26924.
+ if path == cmd {
+ return filepath.SkipDir
+ }
+
want := true
// Avoid .foo, _foo, and testdata directory trees.
_, elem := filepath.Split(path)
! stdout index/suffixarray
# 'go list ...' should list packages in all active modules and the standard library.
+# But not cmd/* - see golang.org/issue/26924.
go list ...
stdout example.com/unused/useerrors
stdout example.com/m/useunsafe
stdout '^unicode$'
stdout '^unsafe$'
stdout index/suffixarray
+! stdout cmd/pprof
# 'go list example.com/m/...' should list packages in all modules that begin with
# "example.com/m/".