2020-10-12 20:42:55 +00:00
|
|
|
//go:generate go run -mod=vendor git.rootprojects.org/root/go-gitver/v2 --package version --outfile ./version/zversion.go
|
2019-06-21 06:01:02 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"example.com/hello/version"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
showVersion := flag.Bool("version", false, "Print version and exit")
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if *showVersion {
|
2020-10-12 20:42:55 +00:00
|
|
|
fmt.Println(version.Commit())
|
|
|
|
fmt.Println(version.Version())
|
|
|
|
fmt.Println(version.Date())
|
2019-06-21 06:01:02 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println("Hello, World!")
|
|
|
|
}
|