mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
13 lines
261 B
Go
13 lines
261 B
Go
package utils
|
|
|
|
import "github.com/spf13/viper"
|
|
|
|
func EnvIsTrue(key string, defaultOk bool) bool {
|
|
isTrueBool := viper.GetBool(key)
|
|
isTrueString := viper.GetString(key)
|
|
if isTrueString == "" {
|
|
return defaultOk
|
|
}
|
|
return isTrueBool || isTrueString == "Y"
|
|
}
|