AlexStocks commented on code in PR #1971:
URL: https://github.com/apache/dubbo-go/pull/1971#discussion_r956689328


##########
dubbogo-cli/cmd/hessian.go:
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package cmd
+
+import (
+       "runtime"
+)
+
+import (
+       "github.com/spf13/cobra"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3/dubbogo-cli/generator/sample"
+       "dubbo.apache.org/dubbo-go/v3/dubbogo-cli/generator/sample/hessian"
+)
+
+// hessianCmd represents the hessian-register-generator command
+var hessianCmd = &cobra.Command{
+       Use:   "hessian",
+       Short: "automatic generate hessian pojo register statement",
+       Run:   generateHessianRegistry,
+}
+
+func init() {
+       rootCmd.AddCommand(hessianCmd)
+       hessianCmd.Flags().StringP(hessian.CmdFlagInclude, "i", "./", "file 
scan directory path, default `./`")
+       hessianCmd.Flags().IntP(hessian.CmdFlagThread, "t", runtime.NumCPU()*2, 
"worker thread limit, default (cpu core) * 2")
+       hessianCmd.Flags().BoolP(hessian.CmdFlagOnlyError, "e", false, "only 
print error message, default false")
+}
+
+func generateHessianRegistry(cmd *cobra.Command, _ []string) {
+       var include string
+       var thread int
+       var onlyError bool
+       var err error

Review Comment:
   放在一个 var () 代码块里面就可以了



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to