service_test.go 324 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "flag"
  4. "fmt"
  5. "path/filepath"
  6. "go-common/app/interface/main/favorite/conf"
  7. )
  8. var (
  9. s *Service
  10. )
  11. func init() {
  12. dir, _ := filepath.Abs("../cmd/favorite-test.toml")
  13. flag.Set("conf", dir)
  14. if err := conf.Init(); err != nil {
  15. fmt.Printf("conf.Init() error(%v)", err)
  16. }
  17. s = New(conf.Conf)
  18. }