|
I knew the e.g. type Node struct {
Name string `json:"name" query:"name,n,code"`
}where |
Answered by
aldas
Oct 27, 2022
Replies: 1 comment 2 replies
|
type Node struct {
Name string `json:"name" query:"name"`
}
n := Node{}
if err := c.Bind(&n); err != nil {
return err
}
err := echo.QueryParamsBinder(c).
// String("name", &n.Name). // <-- not needed as Bind knows that from struct tag
String("n", &n.Name).
String("code", &n.Name).
BindError()
if err != nil {
return err
} |
2 replies
Answer selected by
yinheli
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Binditself does not have that feature, but you could add additional code to do the same