-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: build constraint of 'ignore' is special for modules? #29598
Comments
Change https://golang.org/cl/167159 mentions this issue: |
Commands run: sed -i 's;// +build OMIT;// +build ignore,OMIT;' $(grep -l OMIT -r) go mod init go mod edit -go=1.11 go mod tidy go list -m all go test ./... Updates golang/go#30228 Updates golang/go#29598 Change-Id: I3d0a4787c1158572bed8dd3785ff02e16d1cc1f3 Reviewed-on: https://go-review.googlesource.com/c/talks/+/167159 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
…ps-update will not ignore it and properly vendor in code-generator. But using the build tag will cause the build to not generate a binary for this file. // +build ignore is special apparently golang/go#29598 Signed-off-by: Alexander Wels <awels@redhat.com>
make deps-update will not ignore it and properly vendor in code-generator. Buy using the +build tag will cause the build to not include this code during a build unless the codegen tag is used. // +build ignore is special apparently golang/go#29598 Signed-off-by: Alexander Wels <awels@redhat.com>
make deps-update will not ignore it and properly vendor in k8s.io/code-generator. By using the +build tag will cause the build to not include this code during a build unless the codegen tag is used. // +build ignore is special apparently golang/go#29598 Signed-off-by: Alexander Wels <awels@redhat.com>
make deps-update will not ignore it and properly vendor in k8s.io/code-generator. By using the +build tag will cause the build to not include this code during a build unless the codegen tag is used. // +build ignore is special apparently golang/go#29598 Signed-off-by: Alexander Wels <awels@redhat.com>
https://golang.org/ref/mod#go-mod-tidy now says this:
|
Since this is now documented in https://golang.org/ref/mod#go-mod-tidy, let's close this. We'll need to be careful to document this for other commands that load the full import graph the way that |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes; testing with the beta ahead of the 1.12 release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
using the following module definition:
What did you expect to see?
A passing test.
What did you see instead?
I wasn't aware that the
ignore
build constraint was special but judging from the above it appears to be.ignore
is described as being conventional, but not that it carries any special semantics.The
cmd/go
docs also don't appear to make mention of this special case.Assuming this is the intended behaviour, I think it would be worth updating the docs to call this out. I just spent a good few mins trying to track down a
go mod tidy
bug that in fact turned out to be an instance of a file with a// +build ignore
constraint.cc @bcmills
FYI @mvdan @rogpeppe
The text was updated successfully, but these errors were encountered: