-
-
Notifications
You must be signed in to change notification settings - Fork 7
Home
Carl Johnson edited this page Jun 25, 2022
·
1 revision
Welcome to the versioninfo wiki!
TODO
package main
import (
"flag"
"fmt"
"os"
"github.com/carlmjohnson/flagx"
"github.com/carlmjohnson/versioninfo"
)
func main() {
flagx.BoolFunc(nil, "version", "Print version and exit", myPrint)
flag.Parse()
}
func myPrint() error {
fmt.Println("My app version is", versioninfo.Short())
os.Exit(0)
panic("unreachable")
}