网站首页
编程语言
数据库
系统相关
其他分享
编程问答
37.700
2024-06-23
Cobra - Flags are parsed after rootCmd.Execute()
root.go:funcinit(){rootCmd.PersistentFlags().BoolVarP(&enableLogging,"log","l",true,"Logginginformation")fmt.Println("*************************",enableLogging)}funcExecute(){err: