mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-29 18:00:51 +01:00
feat: added modules
This commit is contained in:
12
core/utils/bool.go
Normal file
12
core/utils/bool.go
Normal file
@@ -0,0 +1,12 @@
|
||||
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"
|
||||
}
|
||||
Reference in New Issue
Block a user