mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
README.md #### Manually create rootCmd demo error
func main(){} must be func initConfig(){}
This commit is contained in:
parent
99ff9334bd
commit
c69668f9ae
1 changed files with 1 additions and 1 deletions
|
@ -323,7 +323,7 @@ func init() {
|
|||
viper.SetDefault("license", "apache")
|
||||
}
|
||||
|
||||
func main() {
|
||||
func initConfig() {
|
||||
// Don't forget to read config either from cfgFile or from home directory!
|
||||
if cfgFile != "" {
|
||||
// Use config file from the flag.
|
||||
|
|
Loading…
Reference in a new issue