#golang Fediverse please help a Go-noob: is it possible to get the `git describe` string from a `go install github.com…@latest` type installation?
In order to use for `--version` output, that in various projects report no version when installed that way.
E.g.:
% go install github.com/walles/moar@latest
% moar --version
Should be set when building, please use build.sh to build
pkg.go.dev/runtime/debug#ReadB…
(That doesn’t work yet when installing from a local directory. See github.com/golang/go/issues/50…)
NOTE: The accepted proposal is #50603 (comment). cmd/go embeds dependency version information in binaries, which is very useful. From Go 1.18 onwards, cmd/go also embeds VCS information in binaries...GitHub
you can use `go version` for that
`go version -m /path/to/binary`
Else, I'll answer it myself linking your answer here.
with pleasure.
Will do immediatly :)
Thanks for doing this.
EDIT: it's done :)