go allows you to do this with ldflags, so you might change a few int variables major, minor, patch when you build; obviously getting the values from git tags isn't an issue there either;
this annoys me because it complicates the build/install command
So I'd like to say "just go install this thing" and also have a no-extra-effort version subcommand that returns something like v1.2.3 (commit: deadbeef); but these goals seem to conflict.
What to do?
a couple of orthogonal goals need to be weighed against each other here
go install github.com/ja-he/dayplan@latest
version
subcommand (or--version
/-v
) is necessarySo I'd like to say "just
go install
this thing" and also have a no-extra-effortversion
subcommand that returns something likev1.2.3 (commit: deadbeef)
; but these goals seem to conflict. What to do?