go-gitver/examples/sub-package/main.go

23 lines
329 B
Go
Raw Permalink Normal View History

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())
return
}
fmt.Println("Hello, World!")
}