From 8aa84b2be68e985b7b7074370c38ba1c9d4a36a3 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Mon, 1 Jun 2020 13:03:10 +0700 Subject: [PATCH] Add build information to the bianry --- main.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/main.go b/main.go index 0d63700..4c7c26f 100644 --- a/main.go +++ b/main.go @@ -8,9 +8,23 @@ import ( "github.com/ngoduykhanh/wireguard-ui/router" "github.com/ngoduykhanh/wireguard-ui/util" "net/http" + "time" ) +var appVersion = "development" +var gitCommit = "N/A" +var gitRef = "N/A" +var buildTime = fmt.Sprintf(time.Now().UTC().Format("01-02-2006 15:04:05")) + func main() { + // print app information + fmt.Println("Wireguard UI") + fmt.Println("App Version\t:", appVersion) + fmt.Println("Git Commit\t:", gitCommit) + fmt.Println("Git Ref\t\t:", gitRef) + fmt.Println("Build Time\t:", buildTime) + fmt.Println("Git Repo\t:", "https://github.com/ngoduykhanh/wireguard-ui") + // initialize DB err := util.InitDB() if err != nil {