MCPcopy
hub / github.com/gin-gonic/gin / ShouldBindUri

Method ShouldBindUri

context.go:909–915  ·  view source on GitHub ↗

ShouldBindUri binds the passed struct pointer using the specified binding engine. It works like ShouldBindJSON but binds parameters from the URI.

(obj any)

Source from the content-addressed store, hash-verified

907// ShouldBindUri binds the passed struct pointer using the specified binding engine.
908// It works like ShouldBindJSON but binds parameters from the URI.
909func (c *Context) ShouldBindUri(obj any) error {
910 m := make(map[string][]string, len(c.Params))
911 for _, v := range c.Params {
912 m[v.Key] = []string{v.Value}
913 }
914 return binding.Uri.BindUri(m, obj)
915}
916
917// ShouldBindWith binds the passed struct pointer using the specified binding engine.
918// See the binding package.

Callers 2

BindUriMethod · 0.95
TestShouldBindUriFunction · 0.80

Calls 1

BindUriMethod · 0.65

Tested by 1

TestShouldBindUriFunction · 0.64