samba/server/other/main.go
2025-06-04 09:51:39 +08:00

32 lines
631 B
Go

package main
import (
"fmt"
"samba/pkg/ksync"
"samba/server/other/cmd"
"samba/server/other/handler"
"samba/server/other/monitor"
"time"
)
var (
GitCommit = "unknown"
GitBranch = "unknown"
BuildDate = "unknown"
)
func main() {
monitor.Init()
handler.SetEnv("GitCommit", GitCommit)
handler.SetEnv("GitBranch", GitBranch)
handler.SetEnv("BuildDate", BuildDate)
tm, err := time.Parse("20060102150405", BuildDate)
if err == nil {
BuildDate = tm.Format("2006-01-02 15:04:05")
}
ksync.RunSafe(func() {
cmd.Run(fmt.Sprintf("版本分支:%v,hash值:%v,编译时间:%v", GitBranch, GitCommit, BuildDate))
}, nil)
}