Go-13-配置文件读取
Viper可以同时从不同的位置读取配置,不同位置的配置具有不同的优先级,高优先级的配置会覆盖低优先级相同的配置,按优先级从高到低排列如下。读取配置只需要调用viper.GetString()、viper.GetInt()和viper.GetBool()等函数即可。// 调用viper.GetString() viper.GetInt() viper.GetBool()在apiserver/conf/config.yaml(默认配置文件名字固定为config.yaml)...
复制链接