(n *Node, u obsoleteUnmarshaler)
| 375 | } |
| 376 | |
| 377 | func (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. |
no test coverage detected