1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 14:50:55 +00:00
This commit is contained in:
ysqi 2016-03-14 19:21:09 +08:00
parent b2a06c5fa0
commit 9c7d95b071

View File

@ -122,12 +122,11 @@ type ConfigContainer struct {
// Bool returns the boolean value for a given key. // Bool returns the boolean value for a given key.
func (c *ConfigContainer) Bool(key string) (bool, error) { func (c *ConfigContainer) Bool(key string) (bool, error) {
v, err := c.getData(key)
if v, err := c.getData(key); err != nil { if err != nil {
return false, err return false, err
} else {
return config.ParseBool(v)
} }
return config.ParseBool(v)
} }
// DefaultBool return the bool value if has no error // DefaultBool return the bool value if has no error