README.md #### Manually create rootCmd demo error

func main(){} must be func initConfig(){}
This commit is contained in:
Bayberry Z 2017-06-08 10:01:31 +08:00 committed by GitHub
parent 99ff9334bd
commit c69668f9ae

View file

@ -323,7 +323,7 @@ func init() {
viper.SetDefault("license", "apache") viper.SetDefault("license", "apache")
} }
func main() { func initConfig() {
// Don't forget to read config either from cfgFile or from home directory! // Don't forget to read config either from cfgFile or from home directory!
if cfgFile != "" { if cfgFile != "" {
// Use config file from the flag. // Use config file from the flag.