5
                            
                                
1. 您使用的是什么版本
                                    
                                
                            
                        Go和系统类型/架构?
go 版本 go1.18.3 linux/amd64
2. 您使用的是什么版本GoFrame?
v2.2.4
3. 最新版本的版本还会重现这个问题吗?是的
4. 你做了什么?package main
import (
    "context"
    "fmt"
    "github.com/gogf/gf/v2/frame/g"
    "github.com/gogf/gf/v2/net/ghttp"
)
type HelloReq struct {
    g.Meta `path:"/hello/{ID}" method:"get"`
    ID     int `v:"required"`
}
type HelloRes struct {
    Reply string `dc:"Reply content"`
}
type Hello struct{}
func (Hello) Say(ctx context.Context, req *HelloReq) (res *HelloRes, err error) {
    g.Log().Debug(ctx, err)
    res = &HelloRes{
        Reply: fmt.Sprintf(`Hi %d`, req.ID),
    }
    return
}
func main() {
    s := g.Server()
    s.Use(ghttp.MiddlewareHandlerResponse)
    s.Group("/", func(group *ghttp.RouterGroup) {
        group.Bind(
            new(Hello),
        )
    })
    s.Run()
}
用户发送短信验证码时直接报错400,流程停止
6. 你看到的是什么?没有报错,返回零值0
$ curl http://localhost:62866/hello/xyz
{"code":0,"message":"","data":{"Reply":"Hi 0"}}
$ curl http://localhost:62866/hello/1
{"code":0,"message":"","data":{"Reply":"Hi 1"}}感觉好处有两点:
- 快速报告错误方便客户端调整参数类型
- 接口的解析一定正确,不需要为零值

