test cobra

This commit is contained in:
wangchuxiao
2023-03-07 18:06:57 +08:00
parent 13132efc6c
commit 6eb13df2e2
2 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ func main() {
startCmd.Flags().IntP(constant.FlagPort, "p", 0, "Port to listen on")
startCmd.Flags().StringP(constant.FlagConf, "c", "", "Path to config file folder")
rootCmd := cmd.NewRootCmd()
cobra.Command(rootCmd).AddCommand(startCmd)
rootCmd.Command.AddCommand(startCmd)
if err := startCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)