Exemplo n.º 1
0
Arquivo: conf.go Projeto: 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
		}
	}
}
Exemplo n.º 2
0
Arquivo: conf.go Projeto: 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
	}

}
Exemplo n.º 3
0
Arquivo: conf.go Projeto: 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
		}
	}
}