golang使用Viper的demo
获取配置例子 package main import ( "flag" "fmt" "runtime" "github.com/spf13/viper" ) type Config struct { Base BaseConf `mapstructure:"base"` } type BaseConf struct { pidfile string `mapstructure:"pidfile"` } var ( Conf *Config confPath string ) func init(...阅读全文