False positive with ShouldBindQuery using gin framework
yiannisccmath opened this issue · comments
Yiannis Koutsoumpidis commented
type queryGetParams struct {
ID *uint64 `form:"id"`
Pagination *uint64 `form:"pagination"`
}
func getUsers(ctx *gin.Context) {
params := queryGetParams{}
if err := ctx.ShouldBindQuery(¶ms); err != nil {
ctx.AbortWithStatusJSON(http.StatusBadRequest, "invalid query params")
return
}
}
above fails with
execinquery It's better to use Execute method instead of ShouldBindQuery method to execute `` query