-
I knew the e.g. type Node struct {
Name string `json:"name" query:"name,n,code"`
} where |
Beta Was this translation helpful? Give feedback.
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
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
yinheli
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bind
itself does not have that feature, but you could add additional code to do the same