bilibili-backup/app/interface/main/web-show/dao/ad/dao_test.go

23 lines
309 B
Go
Raw Permalink Normal View History

2019-04-22 10:59:20 +08:00
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)
}
}