testUtil.go 350 B

12345678910111213141516171819202122
  1. package testx
  2. import (
  3. "github.com/emqx/kuiper/internal/conf"
  4. )
  5. // errstring returns the string representation of an error.
  6. func Errstring(err error) string {
  7. if err != nil {
  8. return err.Error()
  9. }
  10. return ""
  11. }
  12. func GetDbDir() string {
  13. conf.InitConf()
  14. dbDir, err := conf.GetDataLoc()
  15. if err != nil {
  16. conf.Log.Fatal(err)
  17. }
  18. return dbDir
  19. }