/////////////////////////////////////////////////////////////////////////////
// Convenience function to parse a boolean-based environment variable.
//
// envvar(in): Env variable string
// pval(out):  Ptr to an integer to hold the result.
// Return:     true if env var was seen, else false.
/////////////////////////////////////////////////////////////////////////////
Convenience function to parse a boolean-based environment variable.

Env variable string
pval(out):  Ptr to an integer to hold the result.
Return:     true if env var was seen, else false.
///////////////////////////////////////////////////////////////////////////// // Convenience function to parse a boolean - based environment variable . // // envvar ( in ) : Env variable string // pval ( out ) : Ptr to an integer to hold the result . // Return : true if env var was seen else false . /////////////////////////////////////////////////////////////////////////////
func __env_parse_bool(envvar string, pval *bool) bool {
	var val string
	if val = os.Getenv(envvar); val != "" {
		lcut := strings.ToLower(val)
		if (lcut == "0") || (lcut == "no") || (lcut == "off") || (lcut == "false") {
			*pval = false
		} else if (lcut == "1") || (lcut == "yes") || (lcut == "on") || (lcut == "true") {
			*pval = true
		} else {
			logger.Errorf("Invalid %s value '%s'.", envvar, val)
		}
		return true
	}
	return false
}
func __env_parse_bool ( envvar string , pval * bool ) bool { var val string if val = os . Getenv ( envvar ) ; val != " " { lcut := strings . ToLower ( val ) if ( lcut == " " ) || ( lcut == " " ) || ( lcut == " " ) || ( lcut == " " ) { * pval = false } else if ( lcut == " " ) || ( lcut == " " ) || ( lcut == " " ) || ( lcut == " " ) { * pval = true } else { logger . Errorf ( " " , envvar , val ) } return true } return false }
Convenience function to parse a boolean-based environment variable.
Convenience function to parse a boolean - based environment variable .