Fetch the repository succeeded.
package goconf
import (
"strconv"
)
func (cfg Configuration) Sub(key string) Configuration {
temp := cfg.Get(key)
if nil != temp {
if ret, isOk := temp.(Configuration); isOk {
return ret
}
}
return nil
}
func (cfg Configuration) String(key string) string {
temp := cfg.Get(key)
if nil != temp {
if ret, isOk := temp.(string); isOk {
return ret
}
}
return ""
}
func (cfg Configuration) Integer(key string) int {
if ret, e := strconv.Atoi(cfg.String(key)); nil == e {
return ret
}
return 0
}
// It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
// Any other value returns false.
func (cfg Configuration) Bool(key string) bool {
if ret, e := strconv.ParseBool(cfg.String(key)); nil == e {
return ret
}
return false
}
func (cfg Configuration) Float64(key string) float64 {
if ret, e := strconv.ParseFloat(cfg.String(key), 64); nil == e {
return ret
}
return 0.0
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。