mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 18:10:55 +00:00
make golint happy
This commit is contained in:
parent
fdce4af9c8
commit
87650ce8bc
@ -113,7 +113,6 @@ func NewConfigData(adapterName string, data []byte) (Configer, error) {
|
||||
// 0, 0.0, f, F, FALSE, false, False, NO, no, No, N,n, OFF, off, Off.
|
||||
// Any other value returns an error.
|
||||
func ParseBool(val interface{}) (value bool, err error) {
|
||||
|
||||
if val != nil {
|
||||
switch v := val.(type) {
|
||||
case bool:
|
||||
@ -140,7 +139,6 @@ func ParseBool(val interface{}) (value bool, err error) {
|
||||
}
|
||||
}
|
||||
return false, fmt.Errorf("parsing %q: invalid syntax", val)
|
||||
} else {
|
||||
return false, fmt.Errorf("parsing <nil>: invalid syntax")
|
||||
}
|
||||
return false, fmt.Errorf("parsing <nil>: invalid syntax")
|
||||
}
|
||||
|
@ -94,9 +94,8 @@ type ConfigContainer struct {
|
||||
func (c *ConfigContainer) Bool(key string) (bool, error) {
|
||||
if v, ok := c.data[key]; ok {
|
||||
return config.ParseBool(v)
|
||||
} else {
|
||||
return false, fmt.Errorf("not exist key: %q", key)
|
||||
}
|
||||
return false, fmt.Errorf("not exist key: %q", key)
|
||||
}
|
||||
|
||||
// DefaultBool return the bool value if has no error
|
||||
|
@ -123,9 +123,8 @@ type ConfigContainer struct {
|
||||
func (c *ConfigContainer) Bool(key string) (bool, error) {
|
||||
if v, ok := c.data[key]; ok {
|
||||
return config.ParseBool(v)
|
||||
} else {
|
||||
return false, fmt.Errorf("not exist key: %q", key)
|
||||
}
|
||||
return false, fmt.Errorf("not exist key: %q", key)
|
||||
}
|
||||
|
||||
// DefaultBool return the bool value if has no error
|
||||
|
Loading…
Reference in New Issue
Block a user