diff --git a/utils/tests.go b/utils/tests.go index 7ec70d8..42b5816 100644 --- a/utils/tests.go +++ b/utils/tests.go @@ -6,7 +6,7 @@ import ( ) func RegenerativeTest(callback func() error) error { - if !utils_settings.Envs.AreTestsRegenerating.ToBool() { + if !utils_settings.Envs.AreTestsRegenerating { utils_logus.Log.Debug("Skipping test data regenerative code") return nil } diff --git a/utils/utils_env/env.go b/utils/utils_env/env.go index 8947cc0..863df20 100644 --- a/utils/utils_env/env.go +++ b/utils/utils_env/env.go @@ -2,12 +2,6 @@ package utils_env import "os" -type EnvBool string - -func (e EnvBool) ToBool() bool { - return e == "true" -} - type EnvConfig struct{} func NewEnvConfig() EnvConfig { @@ -22,8 +16,8 @@ func (e EnvConfig) GetEnvWithDefault(key string, default_ string) string { } } -func (e EnvConfig) GetEnvBool(key string) EnvBool { - return EnvBool(os.Getenv(key)) +func (e EnvConfig) GetEnvBool(key string) bool { + return os.Getenv(key) == "true" } func (e EnvConfig) GetEnv(key string) string { diff --git a/utils/utils_settings/settings.go b/utils/utils_settings/settings.go index 1a92585..688199b 100644 --- a/utils/utils_settings/settings.go +++ b/utils/utils_settings/settings.go @@ -3,8 +3,8 @@ package utils_settings import "github.com/darklab8/go-utils/utils/utils_env" type UtilsEnvs struct { - IsDevEnv utils_env.EnvBool - AreTestsRegenerating utils_env.EnvBool + IsDevEnv bool + AreTestsRegenerating bool } var Envs UtilsEnvs