Example #1
0
// Bool returns the boolean value for a given key.
func (c *ConfigContainer) Bool(key string) (bool, error) {
	v, err := c.getData(key)
	if err != nil {
		return false, err
	}
	return config.ParseBool(v)
}
Example #2
0
File: xml.go Project: xxoommd/beego
// Bool returns the boolean value for a given key.
func (c *ConfigContainer) Bool(key string) (bool, error) {
	if v := c.data[key]; v != nil {
		return config.ParseBool(v)
	}
	return false, fmt.Errorf("not exist key: %q", key)
}