cmd/go: "ldflags -X" variable setting does not error on bad paths #30782
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What version of Go are you using (
go version
)?1.12 or 1.11
Does this issue reproduce with the latest release?
The latest release on Docker, yes, I have not tried
master
What operating system and processor architecture are you using (
go env
)?The
golang:1.12
docker.What did you do?
go run -ldflags "-X bad/path/bob.Worked=yes" alpha.go
What did you expect to see?
Some error telling me that I have a bad path.
What did you see instead?
The build succeeded and ran.
Discussion
The project I work on recently updated the version of Go we are using, and as part of the update some of the variables we are setting using
ldflags "-X"
stopped getting set because the path we were using was no longer recognized. I know that that mechanism changed, and that is not my objection.Rather my objection is that the builds continued on without any errors to say we were now trying to set variables on modules that did not exist in the build. There should have been build-breaking errors to prompt us to figure out the problem immediately.
The text was updated successfully, but these errors were encountered: