-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (48 loc) · 1.03 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"fmt"
"runtime"
"github.com/davecgh/go-spew/spew"
"github.com/kiga-hub/sparta_backend/cmd"
_ "go.uber.org/automaxprocs"
)
var (
// AppName - app name
AppName string
// AppVersion - app version
AppVersion string
// BuildVersion - build version
BuildVersion string
// BuildTime - build time
BuildTime string
// GitRevision - Git version
GitRevision string
// GitBranch - Git branch
GitBranch string
// GoVersion - Golang information
GoVersion string
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU() - 2)
spew.Config = *spew.NewDefaultConfig()
spew.Config.ContinueOnMethod = true
cmd.AppName = AppName
cmd.AppVersion = AppVersion
Version()
if err := cmd.Execute(); err != nil {
panic(err)
}
}
// Version prints version info of the program
func Version() {
fmt.Printf(
"App Name:\t%s\nApp Version:\t%s\nBuild version:\t%s\nBuild time:\t%s\nGit revision:\t%s\nGit branch:\t%s\nGolang Version: %s\n",
AppName,
AppVersion,
BuildVersion,
BuildTime,
GitRevision,
GitBranch,
GoVersion,
)
}