Open
Description
How to implement group validator?
I have the following structure
type User struct {
UserId int64 `binding:"required,number"`
Name string `json:"name" form:"name" binding:"gte=3"`
}
Now I need to implement findUserById , I have to verify the ID exist, so i use required.
But when I implement saveUser, I have to verify that the ID doesn't exist because my database is a self-increment ID.
They have a conflict
In Java spring boot, they can be distinguished by a custom group