Is it possible to parse query parameters by prefix?
type TimeFramesQuery struct {
Create Period `form:",prefix=create_"`
Update Period `form:",prefix=update_"`
}
type Period struct {
Start time.Time `form:"start_date"`
End time.Time `form:"end_date"`
}
func main() {
u, err := url.Parse("https://example.org/order?create_start_date=2001-01-01&create_end_date=2002-02-11")
if err != nil {
panic(err)
}
var obj TimeFramesQuery
if err := Bind(u, &obj); err != nil {
panic(err)
}
fmt.Println(obj.Create)
}
Comment From: yanzhuiyun
Please assign the issue to me and I will try to solve it
Comment From: nccapo
Anyone fix this error?