Tool to add a --version flag to your binary the prints the git version.
This will add some files to the gitversion package that can be changed with the --pkg flag. You should add the following to your main:
if gitversion.CheckVersionFlag() {
return
}Install:
go install github.com/spudtrooper/gitversionCreate the files:
~/go/bin/gitversionIncrement the tag's most minor version (e.g. v0.0.1 to v0.0.2)
~/go/bin/gitversion --inc