commit | 1031f523bca8b37c114fe1ee5b7241d098f87f63 | [log] [tgz] |
---|---|---|
author | Russ Cox <rsc@golang.org> | Tue Jun 26 21:04:59 2018 -0400 |
committer | Russ Cox <rsc@golang.org> | Fri Jun 29 03:42:06 2018 +0000 |
tree | cf6e1795b52256a1da9aede8cb7e2ef03f02389e | |
parent | 53cf99f54ff9eb693554963f6efa9c493a0aa218 [diff] |
cmd/go: ignore wildcard-matched test-only packages in go build It makes sense to be able to cd into the top of a directory tree and run commands like: go list ./... go test ./... go build ./... go install ./... Some packages have no tests. Some packages have only tests (no code). While go list applies to both kinds of packages, and go test correctly handles packages without tests, go build and go install reject packages with only tests. If you run go install testonlypkg then it does seem reasonable to fail with an error, since testonlypkg cannot actually be installed. But if testonlypkg was only picked up by wildcard expansion, then to keep the examples above working, we should just silently skip over it during go build and go install. CL 23314 fixed this same problem for "go get golang.org/x/tour/..." but special-cased "go get", leaving "go build" and "go install" failing. This CL fixes the general case and removes the "go get" special case. Picked this up in module work because I'm using "go build ./..." as part of evaluating whether repos are compatible with Go modules. Fixes golang/go#20760. Fixes golang/go#22409. Change-Id: I5caaa6a346a5d07a7ad9e2669e89da76b397dc42 Reviewed-on: https://go-review.googlesource.com/121196 Reviewed-by: Bryan C. Mills <bcmills@google.com>
This repository holds a prototype of what the go command might look like with integrated support for package versioning.
See research.swtch.com/vgo for documents about the design.
Use go get -u golang.org/x/vgo
.
You can also manually git clone the repository to $GOPATH/src/golang.org/x/vgo
.
See CONTRIBUTING.md.
This is still a very early prototype. You are likely to run into bugs. Please file bugs in the main Go issue tracker, golang.org/issue, and put the prefix x/vgo:
in the issue title.
Thank you.