package services import ( "os" "github.com/beego/beego/v2/core/logs" beego "github.com/beego/beego/v2/server/web" ) func Init() { Discoveryinit() //First init DC name var DBpoint string var err error DBpoint = os.Getenv("DOCKER_DBPOINT") if len(DBpoint) == 0 { DBpoint, err = beego.AppConfig.String("DBPOINT") if err != nil { logs.Critical("DBPOINT URI error: %v", err) panic(err) } } Mongoinit(DC_NAME + "-" + DBpoint) }