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.
AJ ONeal 3409d5f2e4 update examples 4 years ago
..
tools complete transition to v2 4 years ago
version complete transition to v2 4 years ago
README.md fix docs, add more docs, allow different package name 5 years ago
go.mod update examples 4 years ago
main.go complete transition to v2 4 years ago

README.md

Example

Prints the version or a nice message

Put version in its own packge

This is just like examples/basic, but it uses the package name version instead of main.

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