Merge "IsEnvTrue and IsEnvFalse should take True
and False
as valid values respectively." into main
This commit is contained in:
@@ -818,12 +818,12 @@ func (c *config) GetenvWithDefault(key string, defaultValue string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) IsEnvTrue(key string) bool {
|
func (c *config) IsEnvTrue(key string) bool {
|
||||||
value := c.Getenv(key)
|
value := strings.ToLower(c.Getenv(key))
|
||||||
return value == "1" || value == "y" || value == "yes" || value == "on" || value == "true"
|
return value == "1" || value == "y" || value == "yes" || value == "on" || value == "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *config) IsEnvFalse(key string) bool {
|
func (c *config) IsEnvFalse(key string) bool {
|
||||||
value := c.Getenv(key)
|
value := strings.ToLower(c.Getenv(key))
|
||||||
return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
|
return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user