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/link: linker gives misleading advice on new -ldflags option when option contains spaces #12338
I am migrating from Go 1.4 to Go 1.5. When I build my app, the compiler emits a warning that my -ldflags syntax is likely to be deprecated, and offers a misleading suggestion to correct the warning. My use case is a -X -ldflags value that contains spaces.
If I take a variant of the warning advice, I get
Fiddling around with the quotes, I find this invocation works, which the warning did not help me arrive at:
It's not possible to guess what quoting you need. The linker doesn't know. We could make the message less specific by saying
but that's much less helpful. At least with the specifics you can try to grep for the name or value to find where it came from.