Hi, For a program i provide a pre build binary built with
go install --ldflags "-X main.VERSION=$VERSION" So when users met a problem they can report the version easily and certainty. the version variable is set by default to "0.0.0", could be empty string. What should be the cmd line to give the user so that they can go get, and set the version to the git hash using the build flag ? >From my computer i could do, go install --ldflags "-X main.VERSION=`git log | head -n 1`" // or similar because i have the repo locally. But for an end user which did not clone it locally, how could that happen in one cross platform command line ? Note that i might - hardcode it into the README or godoc, but that require an additional control to generate the file containing the instructions, - or manual update. First solution is available only for those who uses such tool, not everyone. Second solution is prone to errors. thanks. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.