Explorar o código

rewrite (#194)

Co-authored-by: kim <xutao@xiaoheiban.cn>
kingxt %!s(int64=4) %!d(string=hai) anos
pai
achega
f32c6a9b28
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      tools/goctl/api/new/newservice.go

+ 3 - 3
tools/goctl/api/new/newservice.go

@@ -27,9 +27,9 @@ service {{.name}}-api {
 
 func NewService(c *cli.Context) error {
 	args := c.Args()
-	dirName := "greet"
-	if len(args) > 0 {
-		dirName = args.First()
+	dirName := args.First()
+	if len(dirName) == 0 {
+		dirName = "greet"
 	}
 
 	abs, err := filepath.Abs(dirName)