mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 05:16:35 +08:00
Optimize the ShouldBindUri method of the Context struct
This commit is contained in:
parent
7a865dcf1d
commit
488232e296
@ -739,7 +739,7 @@ func (c *Context) ShouldBindHeader(obj any) error {
|
|||||||
|
|
||||||
// ShouldBindUri binds the passed struct pointer using the specified binding engine.
|
// ShouldBindUri binds the passed struct pointer using the specified binding engine.
|
||||||
func (c *Context) ShouldBindUri(obj any) error {
|
func (c *Context) ShouldBindUri(obj any) error {
|
||||||
m := make(map[string][]string)
|
m := make(map[string][]string, len(c.Params))
|
||||||
for _, v := range c.Params {
|
for _, v := range c.Params {
|
||||||
m[v.Key] = []string{v.Value}
|
m[v.Key] = []string{v.Value}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user