bilibili-backup/app/admin/main/growup/service/income/service_test.go

29 lines
387 B
Go
Raw Normal View History

2019-04-22 10:59:20 +08:00
package income
import (
"flag"
"path/filepath"
"time"
"go-common/app/admin/main/growup/conf"
)
var (
s *Service
)
func init() {
dir, _ := filepath.Abs("../../cmd/growup-admin.toml")
flag.Set("conf", dir)
conf.Init()
s = New(conf.Conf)
time.Sleep(time.Second)
}
func WithService(f func(s *Service)) func() {
return func() {
// Reset(func() { CleanCache() })
f(s)
}
}