package main import ( "flag" "fmt" "git.noahlan.cn/northlan/ntools-go/logger" "live-gateway/bilibili" "live-gateway/config" "sync" ) var configFile = flag.String("f", "./config.yml", "the config file") func main() { flag.Parse() config.Init(*configFile) if err := logger.InitLogger(&config.Config.Log.File, &config.Config.Log.Console); err != nil { fmt.Println("初始化logger错误", err) } defer logger.Sync() var wg sync.WaitGroup if config.Config.Bilibili.Enabled { wg.Add(1) bLive := bilibili.NewLiveBilibili() go func() { if err := bLive.Serve(); err != nil { logger.SLog.Error("err: ", err) wg.Done() } }() } wg.Wait() }