Example #1
0
File: conf.go Project: paczian/AWE
func getDefinedValueBool(c *config.Config, section string, key string, target *bool) {
	if c.HasOption(section, key) {
		if bool_value, err := c.Bool(section, key); err == nil {
			*target = bool_value
		}
	}
}
Example #2
0
File: conf.go Project: paczian/AWE
func getDefinedValueString(c *config.Config, section string, key string, target *string) {
	if string_value, err := c.String(section, key); err == nil {
		string_value = os.ExpandEnv(string_value)
		*target = string_value
	}

}
Example #3
0
File: conf.go Project: paczian/AWE
// writes to target only if has been defined in config
// avoids overwriting of default values if config is not defined
func getDefinedValueInt(c *config.Config, section string, key string, target *int) {
	if c.HasOption(section, key) {
		if int_value, err := c.Int(section, key); err == nil {
			*target = int_value
		}
	}
}