service_test.go 305 B

12345678910111213141516171819
  1. package service
  2. import (
  3. "flag"
  4. "path/filepath"
  5. "go-common/app/job/main/search/conf"
  6. )
  7. func WithService(f func(s *Service)) func() {
  8. return func() {
  9. dir, _ := filepath.Abs("../goconvey.toml")
  10. flag.Set("conf", dir)
  11. conf.Init()
  12. s := New(conf.Conf)
  13. // s.dao = dao.New(conf.Conf)
  14. f(s)
  15. }
  16. }