As title, since I'm a newbie to golang, I'm a little bit confused of the binding tag for some custom format.
For example, there's a struct with a few of fields like this
type user struct {
name `json:"name" binding:"required"`
hobby `json:"name" binding:"required"`
}
and the name field is supposed to support lowercase and underscore only (e.g. john_cage, david) but after I read the document of validator, still have no idea about that. validator github Is there's any good suggestion or solution for my case? Thanks in advance.
Read the document, google similar questions, try to compose the customer binding tag, etc.