package main import ( "flag" "git.gz.internal.jumaiyx.cn/pkg/config" idencode "git.gz.internal.jumaiyx.cn/pkg/id-encode" "git.gz.internal.jumaiyx.cn/pkg/log" "os" ) var ( Name string Version string id, _ = os.Hostname() ) func main() { flag.Parse() c, err := config.New().Conf("./configs/config.yaml") if err != nil { panic(err) } bc := c.Get() l := log.NewLogger(c.Get().Log) encoding, err := idencode.NewIDEncoding("uid", bc.IdEncode.Uid.Salt, int(bc.IdEncode.Uid.MinLength)) if err != nil { panic(err) } app, cleanup, err := wireApp(bc.Data, encoding, l) if err != nil { panic(err) } defer cleanup() app.Run() // start and wait for stop signal //if err = app.Run(); err != nil { // panic(err) //} }