-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: compile environment variable into binary during `go get' #22216
Comments
There are no such plans. Any discussion should take place on golang-dev. This seems like a set of possible solutions rather than a problem. Do you want to restate this in the form of a problem? |
@ianlancetaylor thanks, let me try: Problem: |
I'm sure I'm missing something, but it seems to me that any version number ought to be set in the master source code. I don't see why I would want the version to depend on the characteristics of the machine where the program happens to be built. |
@ianlancetaylor I understand your point of view. So, is the recommended practice to commit the |
That is what I would do, yes. |
Likely a dup of #22147, which is a more narrow proposal and would not require running arbitrary code. Both seem to be looking at the same root problem. |
You're right, I think it is dup of #22147. |
Hi gophers,
there are lots of "go get"-able CLI programs out there on Github but most of them don't have a built-in
version
flag/sub-command, just because it's almost impossible to compile an environment variable into a binary during thego get -u <pkg/cmd>
invocation.I wonder, are there any plans on making
go get
more robust and let itgo:generate
automatically ongo get
?go get
, an equivalent of explicit-ldflags "-X main.Version=$(git describe --tags)"
?I know this all can be "automated" in Makefile, but the question is if we can ever expect the
go get
command to get this right too?This would naturally provide a simple solution for issues like golang/dep#209 (comment)
The text was updated successfully, but these errors were encountered: