Skip to content

Commit d62a16c

Browse files
committed
fix: logger err field
1 parent a254ef0 commit d62a16c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cmd/protoc-gen-go-gin/internal/generate/handler/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (h *{{.LowerServiceName}}Handler) {{.MethodName}}(ctx context.Context, req
7777
// example:
7878
// {{if .IsIgnoreShouldBind}}c, ctx := middleware.AdaptCtx(ctx)
7979
// if err = c.ShouldBindJSON(req); err != nil {
80-
// logger.Warn("ShouldBindJSON error", logger.Error(err), middleware.CtxRequestIDField(ctx))
80+
// logger.Warn("ShouldBindJSON error", logger.Err(err), middleware.CtxRequestIDField(ctx))
8181
// return nil, ecode.InvalidParams.Err()
8282
// }{{else}}{{if .IsPassGinContext}}c, ctx := middleware.AdaptCtx(ctx){{end}}{{end}}
8383
// err := req.Validate()

cmd/protoc-gen-go-gin/internal/generate/service/template.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (c *{{.LowerServiceName}}Client) {{.MethodName}}(ctx context.Context, req *
6565
// example:
6666
// {{if .IsIgnoreShouldBind}}gc, ctx := middleware.AdaptCtx(ctx)
6767
// if err = gc.ShouldBindJSON(req); err != nil {
68-
// logger.Warn("ShouldBindJSON error", logger.Error(err), middleware.CtxRequestIDField(ctx))
68+
// logger.Warn("ShouldBindJSON error", logger.Err(err), middleware.CtxRequestIDField(ctx))
6969
// return nil, ecode.StatusInvalidParams.Err()
7070
// }{{else}}{{if .IsPassGinContext}}gc, ctx := middleware.AdaptCtx(ctx){{end}}{{end}}
7171
// err := req.Validate()

cmd/sponge/commands/patch/gen-db-init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ func GenerateDBInitCommand() *cobra.Command {
3030
Example: color.HiBlackString(` # Generate mysql initialization code.
3131
sponge patch gen-db-init --module-name=yourModuleName --db-driver=mysql
3232
33-
# Generate database initialization code, auto detect the database driver name.
34-
sponge patch gen-db-init --module-name=yourModuleName
33+
# Generate database initialization code, auto detect the database driver name, may be failed if the handler or service directory is not exists.
34+
sponge patch gen-db-init --out=./yourServerDir
3535
3636
# Generate mysql initialization code, and specify the server directory, Note: code generation will be canceled when the latest generated file already exists.
3737
sponge patch gen-db-init --db-driver=mysql --out=./yourServerDir`),

0 commit comments

Comments
 (0)