| 348 | } |
| 349 | |
| 350 | func (d *decoder) terror(n *Node, tag string, out reflect.Value) { |
| 351 | if n.Tag != "" { |
| 352 | tag = n.Tag |
| 353 | } |
| 354 | value := n.Value |
| 355 | if tag != seqTag && tag != mapTag { |
| 356 | if len(value) > 10 { |
| 357 | value = " `" + value[:7] + "...`" |
| 358 | } else { |
| 359 | value = " `" + value + "`" |
| 360 | } |
| 361 | } |
| 362 | d.terrors = append(d.terrors, fmt.Sprintf("line %d: cannot unmarshal %s%s into %s", n.Line, shortTag(tag), value, out.Type())) |
| 363 | } |
| 364 | |
| 365 | func (d *decoder) callUnmarshaler(n *Node, u Unmarshaler) (good bool) { |
| 366 | err := u.UnmarshalYAML(n) |