#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
Tanguy ⧓ Herrmann
in reply to Lapo Luchini • • •you can use `go version` for that
`go version -m /path/to/binary`
Lapo Luchini likes this.
Lapo Luchini
in reply to Tanguy ⧓ Herrmann • •Else, I'll answer it myself linking your answer here.
Tanguy ⧓ Herrmann
in reply to Lapo Luchini • • •with pleasure.
Will do immediatly :)
Thanks for doing this.
EDIT: it's done :)
Lapo Luchini likes this.
Filippo Valsorda
in reply to Lapo Luchini • • •pkg.go.dev/runtime/debug#ReadB…
(That doesn’t work yet when installing from a local directory. See github.com/golang/go/issues/50…)
cmd/go: stamp the pseudo-version in builds generated by `go build` · Issue #50603 · golang/go
GitHubLapo Luchini likes this.
Lapo Luchini
in reply to Filippo Valsorda • •moar --version
to use that.Lapo Luchini
in reply to Lapo Luchini • •