diff options
author | Russ Cox <rsc@golang.org> | 2018-08-20 21:35:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2018-08-21 02:41:58 +0000 |
commit | df6aedb630b3c79ff50147a85278a17702dcff1f (patch) | |
tree | e277ee822a38a8e6b67bbd0678baad3653aed91b /src/cmd/go/internal/list/list.go | |
parent | c652a1b9c041a2d359665f01de21b19d53ba5ce5 (diff) | |
download | go-df6aedb630b3c79ff50147a85278a17702dcff1f.tar.gz go-df6aedb630b3c79ff50147a85278a17702dcff1f.zip |
cmd/go: fix list -compiled of package with only tests
Fixes #27097.
Change-Id: I6aa48a1c58a21fd320b0e9dcd1f86c90172f0182
Reviewed-on: https://go-review.googlesource.com/130139
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/go/internal/list/list.go')
-rw-r--r-- | src/cmd/go/internal/list/list.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go index 186b006c12..f3cb4e47ec 100644 --- a/src/cmd/go/internal/list/list.go +++ b/src/cmd/go/internal/list/list.go @@ -510,7 +510,9 @@ func runList(cmd *base.Command, args []string) { a := &work.Action{} // TODO: Use pkgsFilter? for _, p := range pkgs { - a.Deps = append(a.Deps, b.AutoAction(work.ModeInstall, work.ModeInstall, p)) + if len(p.GoFiles)+len(p.CgoFiles) > 0 { + a.Deps = append(a.Deps, b.AutoAction(work.ModeInstall, work.ModeInstall, p)) + } } b.Do(a) } |