package main import ( "fmt" c "github.com/gookit/config/v2" "github.com/gookit/config/v2/yaml" "live-gateway/bilibili" "live-gateway/config" "sync" ) var Config config.Config func init() { var err error c.AddDriver(yaml.Driver) err = c.LoadFiles("config.yaml") if err != nil { return } err = c.BindStruct("", &Config) if err != nil { return } fmt.Printf("%+v\n", Config) } func main() { var wg sync.WaitGroup bLive := bilibili.NewLiveBilibili(&Config.Bilibili) wg.Add(1) go func() { if err := bLive.Serve(); err != nil { wg.Done() panic(err) } }() wg.Wait() }