dao_test.go 298 B

123456789101112131415161718192021222324
  1. package dao
  2. import (
  3. "flag"
  4. "os"
  5. "testing"
  6. "go-common/app/admin/ep/saga/conf"
  7. )
  8. var (
  9. d *Dao
  10. )
  11. func TestMain(m *testing.M) {
  12. flag.Set("conf", "../cmd/saga-admin-test.toml")
  13. flag.Parse()
  14. if err := conf.Init(); err != nil {
  15. panic(err)
  16. }
  17. d = New()
  18. defer d.Close()
  19. os.Exit(m.Run())
  20. }