Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: "go get -d" can error with "build constraints exclude all Go files" in 1.12 #31661
In Go 1.12, using module mode "go get -d" now spuriously errors "build constraints exclude all Go files", if invoked on a module whose root package does indeed have build constraints excluding all Go files. A module for which this is the case, is google.golang.org/genproto
However, it should not, as I only asked for go get to download the module and add it to my go.mod file, not to build the root package of the module.
This worked in Go 1.11.
What did you do?
Download the go1.11.9 and go1.12.4 distributions and unpack (I put them in /opt/go-$goversion)
Create the following script as gorepro.sh, which essentially just runs "go get -d google.golang.org/genproto" in a clean environment and echos the exit status:
What did you expect to see?
Using Go 1.11.x it works, returning zero exit status:
What did you see instead?
Using Go 1.12.x it now fails: