//GetEnvAsBool function will fetch the value from environment variable and convert that to an GetEnvAsBool.
//If the value is absent then it will return defaultVal supplied.
// Valid boolean values are  1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
GetEnvAsBool function will fetch the value from environment variable and convert that to an GetEnvAsBool.
If the value is absent then it will return defaultVal supplied.
Valid boolean values are  1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
// GetEnvAsBool function will fetch the value from environment variable and convert that to an GetEnvAsBool . // If the value is absent then it will return defaultVal supplied . // Valid boolean values are 1 t T TRUE true True 0 f F FALSE false False .
func GetEnvAsBool(key string, defaultVal bool) (bool, error) {
	if value, ok := os.LookupEnv(key); ok {
		return strconv.ParseBool(value)
	}
	return defaultVal, nil
}
func GetEnvAsBool ( key string , defaultVal bool ) ( bool , error ) { if value , ok := os . LookupEnv ( key ) ; ok { return strconv . ParseBool ( value ) } return defaultVal , nil }
GetEnvAsBool function will fetch the value from environment variable and convert that to an GetEnvAsBool.
GetEnvAsBool function will fetch the value from environment variable and convert that to an GetEnvAsBool .