Use git tags to add (GoReleaser-compatible) semver to your go package.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

435 B

Example

Prints the version or a nice message

Doesn't have a separate tools package

This is just like examples/sub-package except that its //go:generate is in main.go and it outputs ./version/zversion.go instead of xversion.go.

See examples/basic for more details.

Demo

go mod tidy
go mod vendor
go generate -mod=vendor ./...
go build -mod=vendor -o hello *.go
./hello
./hello --version