Print version on startup, set this via -ldflags "-X main.version=foo"
This commit is contained in:
parent
2fb2e5f151
commit
bbeb0d0e2b
1 changed files with 3 additions and 0 deletions
3
main.go
3
main.go
|
@ -18,6 +18,7 @@ import (
|
|||
|
||||
var (
|
||||
flagHelp bool
|
||||
version string
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -25,6 +26,8 @@ func init() {
|
|||
}
|
||||
|
||||
func main() {
|
||||
log.Println("SpaceAPId version", version)
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if flagHelp {
|
||||
|
|
Loading…
Reference in a new issue