标签: go,golang

1 篇文章

thumbnail
go配置管理-Viper的简单使用
此文章只是对Viper库的简单使用,读取本地配置文件(json,yaml....) 其他使用操作可以观看官方文档 配置类 MySQL import ( "fmt" ) // MySQL配置 type mysqlConfig struct { Host string `mapstructure:"host" yaml:"host"` // 主机 Po…