chore: update go-zero to v1.2.5 (#1410)

This commit is contained in:
Kevin Wan
2022-01-03 21:54:53 +08:00
committed by GitHub
parent 89ce5e492b
commit e267d94ee1
8 changed files with 25 additions and 25 deletions

View File

@@ -14,7 +14,7 @@ import (
"github.com/tal-tech/go-zero/core/errorx"
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
"github.com/tal-tech/go-zero/tools/goctl/api/util"
ctlutil "github.com/tal-tech/go-zero/tools/goctl/util/pathx"
"github.com/tal-tech/go-zero/tools/goctl/util/pathx"
"github.com/urfave/cli"
)
@@ -124,7 +124,7 @@ func apiFormat(data string, filename ...string) (string, error) {
newLineCount++
} else {
if preLine == rightBrace {
builder.WriteString(ctlutil.NL)
builder.WriteString(pathx.NL)
}
newLineCount = 0
}
@@ -152,7 +152,7 @@ func apiFormat(data string, filename ...string) (string, error) {
}
}
util.WriteIndent(&builder, tapCount)
builder.WriteString(line + ctlutil.NL)
builder.WriteString(line + pathx.NL)
if strings.HasSuffix(noCommentLine, leftParenthesis) || strings.HasSuffix(noCommentLine, leftBrace) {
tapCount++
}
@@ -168,10 +168,10 @@ func formatGoTypeDef(line string, scanner *bufio.Scanner, builder *strings.Build
if strings.HasPrefix(noCommentLine, "type") && (strings.HasSuffix(noCommentLine, leftParenthesis) ||
strings.HasSuffix(noCommentLine, leftBrace)) {
var typeBuilder strings.Builder
typeBuilder.WriteString(mayInsertStructKeyword(line, &tokenCount) + ctlutil.NL)
typeBuilder.WriteString(mayInsertStructKeyword(line, &tokenCount) + pathx.NL)
for scanner.Scan() {
noCommentLine := util.RemoveComment(scanner.Text())
typeBuilder.WriteString(mayInsertStructKeyword(scanner.Text(), &tokenCount) + ctlutil.NL)
typeBuilder.WriteString(mayInsertStructKeyword(scanner.Text(), &tokenCount) + pathx.NL)
if noCommentLine == rightBrace || noCommentLine == rightParenthesis {
tokenCount--
}