err := c.ShouldBindQuery(&req)Reads query parameters from the HTTP request (?foo=bar&baz=123), maps them to struct fields via struct tags, and populates req. Returns nil on success, an error on type mismatch.
Pass a pointer (&req) so the function can populate the struct in place.
See also
- gin-route-ordering — route order matters when combining path params and query params