bilibili-backup/app/interface/main/web-show/dao/ad/dao_test.go
2019-04-22 02:59:20 +00:00

23 lines
309 B
Go

package ad
import (
"flag"
"path/filepath"
"go-common/app/interface/main/web-show/conf"
)
var d *Dao
func WithDao(f func(d *Dao)) func() {
return func() {
dir, _ := filepath.Abs("../cmd/web-show-test.toml")
flag.Set("conf", dir)
conf.Init()
if d == nil {
d = New(conf.Conf)
}
f(d)
}
}