1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 22:20:18 +00:00
This commit is contained in:
Ming Deng
2020-08-29 01:17:43 +08:00
parent c2361170b3
commit 81b9a1382a
11 changed files with 215 additions and 57 deletions
.travis.yml
pkg
client
httplib
testing
infrastructure
server
scripts

@ -214,11 +214,9 @@ func (c *ConfigContainer) String(key string) (string, error) {
if v, err := c.getData(key); err == nil {
if vv, ok := v.(string); ok {
return vv, nil
} else {
return "", errors.New(fmt.Sprintf("the value is not string, key: %s, value: %v", key, v))
}
}
return "", errors.New(fmt.Sprintf("configuration not found, key: %s", key))
return "", nil
}
// DefaultString returns the string value for a given key.