Q1mi / BlogComments

9 stars 0 forks source link

Go语言配置管理神器——Viper中文教程 | 李文周的博客 #178

Open Q1mi opened 1 year ago

Q1mi commented 1 year ago

https://www.liwenzhou.com/posts/Go/viper/

李文周的Blog viper 配置管理 go config yaml json etcd Consul toml 配置 热加载

Q1mi commented 1 year ago

SetConfigType 是用来设置远程源返回的配置类型。例如“json”。

SetConfigName 和 AddConfigPath 搭配起来用,通过指定文件名和路径让viper自行查找配置文件。

SetConfigFile 是用来设置配置文件路径的。