Salta al contenuto principale


#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
in reply to Lapo Luchini

you can use `go version` for that

`go version -m /path/to/binary`

in reply to Lapo Luchini

with pleasure.
Will do immediatly :)
Thanks for doing this.

EDIT: it's done :)

Questa voce è stata modificata (3 mesi fa)
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…)