Ai
1 Star 0 Fork 0

zhuim/zmf

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.go 416 Bytes
一键复制 编辑 原始数据 按行查看 历史
zmf 提交于 2023-03-04 15:07 +08:00 . zmf
package zconfig
import (
"github.com/spf13/viper"
)
func GetCfg(key string) interface{} {
viper.SetConfigFile("./config.json")
err := viper.ReadInConfig()
if err != nil {
return nil
}
return viper.Get(key)
}
func GetCfgSt(key string, dat interface{}) bool {
viper.SetConfigFile("./config.json")
err := viper.ReadInConfig()
if err != nil {
return false
}
viper.UnmarshalKey(key, dat)
return true
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/phpvipzm/zmf.git
git@gitee.com:phpvipzm/zmf.git
phpvipzm
zmf
zmf
v0.3.1

搜索帮助