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.

22 lines
329 B

package main
import (
"flag"
"fmt"
"example.com/hello/version"
)
func main() {
showVersion := flag.Bool("version", false, "Print version and exit")
flag.Parse()
if *showVersion {
fmt.Println(version.Commit())
fmt.Println(version.Version())
fmt.Println(version.Date())
return
}
fmt.Println("Hello, World!")
}