MCPcopy
hub / github.com/go-yaml/yaml / callObsoleteUnmarshaler

Method callObsoleteUnmarshaler

decode.go:377–397  ·  view source on GitHub ↗
(n *Node, u obsoleteUnmarshaler)

Source from the content-addressed store, hash-verified

375}
376
377func (d *decoder) callObsoleteUnmarshaler(n *Node, u obsoleteUnmarshaler) (good bool) {
378 terrlen := len(d.terrors)
379 err := u.UnmarshalYAML(func(v interface{}) (err error) {
380 defer handleErr(&err)
381 d.unmarshal(n, reflect.ValueOf(v))
382 if len(d.terrors) > terrlen {
383 issues := d.terrors[terrlen:]
384 d.terrors = d.terrors[:terrlen]
385 return &TypeError{issues}
386 }
387 return nil
388 })
389 if e, ok := err.(*TypeError); ok {
390 d.terrors = append(d.terrors, e.Errors...)
391 return false
392 }
393 if err != nil {
394 fail(err)
395 }
396 return true
397}
398
399// d.prepare initializes and dereferences pointers and calls UnmarshalYAML
400// if a value is found to implement it.

Callers 1

prepareMethod · 0.95

Calls 4

unmarshalMethod · 0.95
handleErrFunction · 0.85
failFunction · 0.85
UnmarshalYAMLMethod · 0.65

Tested by

no test coverage detected