Skip to content
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/link: Support absolute import paths for main packages with -X #13676

Open
tsenart opened this issue Dec 18, 2015 · 3 comments
Open

cmd/link: Support absolute import paths for main packages with -X #13676

tsenart opened this issue Dec 18, 2015 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@tsenart
Copy link

tsenart commented Dec 18, 2015

What version of Go are you using (go version)?

go1.5.1

What operating system and processor architecture are you using?

darwin/amd64

What did you do?
$ go get -ldflags="-X github.com/tsenart/hello.Version=v0.0.1" github.com/tsenart/hello
$ hello
What did you expect to see?
v0.0.1
What did you see instead?

@tsenart
Copy link
Author

tsenart commented Dec 18, 2015

The context where this would be useful is when compiling many main packages with go build ./... and wanting to inject versions at build time for all of them in a single -ldflags. We can simply build each command separately but that slows everything down massively due to the duplicate building of interdependencies.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Dec 18, 2015
@minux
Copy link
Member

minux commented Dec 18, 2015 via email

@tsenart
Copy link
Author

tsenart commented Dec 18, 2015

@minux: Yes, I figured that out. Would it be a possibility to make it absolute instead?

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

4 participants