MCPcopy Index your code
hub / github.com/labstack/echo / BindUnmarshaler

Method BindUnmarshaler

binder.go:313–327  ·  view source on GitHub ↗

BindUnmarshaler binds parameter to destination implementing BindUnmarshaler interface

(sourceParam string, dest BindUnmarshaler)

Source from the content-addressed store, hash-verified

311
312// BindUnmarshaler binds parameter to destination implementing BindUnmarshaler interface
313func (b *ValueBinder) BindUnmarshaler(sourceParam string, dest BindUnmarshaler) *ValueBinder {
314 if b.failFast && b.errors != nil {
315 return b
316 }
317
318 tmp := b.ValueFunc(sourceParam)
319 if tmp == "" {
320 return b
321 }
322
323 if err := dest.UnmarshalParam(tmp); err != nil {
324 b.setError(b.ErrorFunc(sourceParam, []string{tmp}, "failed to bind field value to BindUnmarshaler interface", err))
325 }
326 return b
327}
328
329// MustBindUnmarshaler requires parameter value to exist to bind to destination implementing BindUnmarshaler interface.
330// Returns error when value does not exist

Callers 1

Calls 2

setErrorMethod · 0.95
UnmarshalParamMethod · 0.65

Tested by 1