Merge "IsEnvTrue and IsEnvFalse should take True and False as valid values respectively." into main

This commit is contained in:
Aditya Kumar
2024-05-02 18:14:59 +00:00
committed by Gerrit Code Review

View File

@@ -818,12 +818,12 @@ func (c *config) GetenvWithDefault(key string, defaultValue string) string {
}
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"
}
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"
}