You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
372 B
24 lines
372 B
package service |
|
|
|
import ( |
|
"flag" |
|
"path/filepath" |
|
"time" |
|
|
|
"go-common/app/admin/main/esports/conf" |
|
) |
|
|
|
var svf *Service |
|
|
|
func WithService(f func(s *Service)) func() { |
|
return func() { |
|
dir, _ := filepath.Abs("../cmd/esports-admin-test.toml") |
|
flag.Set("conf", dir) |
|
conf.Init() |
|
if svf == nil { |
|
svf = New(conf.Conf) |
|
} |
|
time.Sleep(2 * time.Second) |
|
f(svf) |
|
} |
|
}
|
|
|