You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/06/05 07:11:59 UTC

[GitHub] [apisix-dashboard] tokers commented on a change in pull request #1932: feat: split cmd package code

tokers commented on a change in pull request #1932:
URL: https://github.com/apache/apisix-dashboard/pull/1932#discussion_r645954554



##########
File path: api/cmd/root.go
##########
@@ -42,30 +42,23 @@ import (
 )
 
 var (
-	showVersion bool
-	Version     string
-	GitHash     string
-	service     *Service
+	configFile string
 )
 
-func printInfo() {
-	fmt.Fprint(os.Stdout, "The manager-api is running successfully!\n\n")
-	printVersion()
-	fmt.Fprintf(os.Stdout, "%-8s: %s:%d\n", "Listen", conf.ServerHost, conf.ServerPort)
-	if conf.SSLCert != "" && conf.SSLKey != "" {
-		fmt.Fprintf(os.Stdout, "%-8s: %s:%d\n", "HTTPS Listen", conf.SSLHost, conf.SSLPort)
-	}
-	fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Loglevel", conf.ErrorLogLevel)
-	fmt.Fprintf(os.Stdout, "%-8s: %s\n\n", "Logfile", conf.ErrorLogPath)
-}
-
-func printVersion() {
-	fmt.Fprintf(os.Stdout, "%-8s: %s\n", "Version", Version)
-	fmt.Fprintf(os.Stdout, "%-8s: %s\n", "GitHash", GitHash)
+var rootCmd = &cobra.Command{
+	Use:   "manager-api [flags]",
+	Short: "Apache APISIX Manager API",

Review comment:
       We may don't need the RunE handler as we put all functions into a bunch of subcommands.

##########
File path: api/go.mod
##########
@@ -1,13 +1,13 @@
 module github.com/apisix/manager-api
 
-go 1.13
+go 1.16

Review comment:
       IMHO We should not change the lowest GO version, do you use any new features in Go/1.16?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org