Browse Source

fix code format style use const config.DefaultFormat

tanglihao 2 năm trước cách đây
mục cha
commit
a40d8b0684
2 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 3 2
      tools/goctl/api/cmd.go
  2. 3 2
      tools/goctl/rpc/cmd.go

+ 3 - 2
tools/goctl/api/cmd.go

@@ -12,6 +12,7 @@ import (
 	"github.com/zeromicro/go-zero/tools/goctl/api/new"
 	"github.com/zeromicro/go-zero/tools/goctl/api/tsgen"
 	"github.com/zeromicro/go-zero/tools/goctl/api/validate"
+	"github.com/zeromicro/go-zero/tools/goctl/config"
 	"github.com/zeromicro/go-zero/tools/goctl/plugin"
 )
 
@@ -127,7 +128,7 @@ func init() {
 		"https://github.com/zeromicro/go-zero-template directory structure")
 	goCmd.Flags().StringVar(&gogen.VarStringBranch, "branch", "", "The branch of "+
 		"the remote repo, it does work with --remote")
-	goCmd.Flags().StringVar(&gogen.VarStringStyle, "style", "gozero", "The file naming format,"+
+	goCmd.Flags().StringVar(&gogen.VarStringStyle, "style", config.DefaultFormat, "The file naming format,"+
 		" see [https://github.com/zeromicro/go-zero/blob/master/tools/goctl/config/readme.md]")
 
 	javaCmd.Flags().StringVar(&javagen.VarStringDir, "dir", "", "The target dir")
@@ -146,7 +147,7 @@ func init() {
 		"https://github.com/zeromicro/go-zero-template directory structure")
 	newCmd.Flags().StringVar(&new.VarStringBranch, "branch", "", "The branch of "+
 		"the remote repo, it does work with --remote")
-	newCmd.Flags().StringVar(&new.VarStringStyle, "style", "gozero", "The file naming format,"+
+	newCmd.Flags().StringVar(&new.VarStringStyle, "style", config.DefaultFormat, "The file naming format,"+
 		" see [https://github.com/zeromicro/go-zero/blob/master/tools/goctl/config/readme.md]")
 
 	pluginCmd.Flags().StringVarP(&plugin.VarStringPlugin, "plugin", "p", "", "The plugin file")

+ 3 - 2
tools/goctl/rpc/cmd.go

@@ -2,6 +2,7 @@ package rpc
 
 import (
 	"github.com/spf13/cobra"
+	"github.com/zeromicro/go-zero/tools/goctl/config"
 	"github.com/zeromicro/go-zero/tools/goctl/rpc/cli"
 )
 
@@ -53,7 +54,7 @@ func init() {
 
 	newCmd.Flags().StringSliceVar(&cli.VarStringSliceGoOpt, "go_opt", nil, "")
 	newCmd.Flags().StringSliceVar(&cli.VarStringSliceGoGRPCOpt, "go-grpc_opt", nil, "")
-	newCmd.Flags().StringVar(&cli.VarStringStyle, "style", "gozero", "The file "+
+	newCmd.Flags().StringVar(&cli.VarStringStyle, "style", config.DefaultFormat, "The file "+
 		"naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]")
 	newCmd.Flags().BoolVar(&cli.VarBoolIdea, "idea", false, "Whether the command "+
 		"execution environment is from idea plugin.")
@@ -79,7 +80,7 @@ func init() {
 	protocCmd.Flags().StringSliceVar(&cli.VarStringSlicePlugin, "plugin", nil, "")
 	protocCmd.Flags().StringSliceVarP(&cli.VarStringSliceProtoPath, "proto_path", "I", nil, "")
 	protocCmd.Flags().StringVar(&cli.VarStringZRPCOut, "zrpc_out", "", "The zrpc output directory")
-	protocCmd.Flags().StringVar(&cli.VarStringStyle, "style", "gozero", "The file "+
+	protocCmd.Flags().StringVar(&cli.VarStringStyle, "style", config.DefaultFormat, "The file "+
 		"naming format, see [https://github.com/zeromicro/go-zero/tree/master/tools/goctl/config/readme.md]")
 	protocCmd.Flags().StringVar(&cli.VarStringHome, "home", "", "The goctl home "+
 		"path of the template, --home and --remote cannot be set at the same time, if they are, "+