mirror of
https://github.com/spf13/cobra
synced 2024-08-23 01:06:28 +00:00
README.md #### Manually create rootCmd demo error
func main(){} must be func initConfig(){}
This commit is contained in:
parent
99ff9334bd
commit
c69668f9ae
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue