コード例 #1
0
ファイル: conf.go プロジェクト: 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
		}
	}
}
コード例 #2
0
ファイル: conf.go プロジェクト: 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
		}
	}
}