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

Method terror

decode.go:350–363  ·  view source on GitHub ↗
(n *Node, tag string, out reflect.Value)

Source from the content-addressed store, hash-verified

348}
349
350func (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
365func (d *decoder) callUnmarshaler(n *Node, u Unmarshaler) (good bool) {
366 err := u.UnmarshalYAML(n)

Callers 3

scalarMethod · 0.95
sequenceMethod · 0.95
mappingMethod · 0.95

Calls 1

shortTagFunction · 0.85

Tested by

no test coverage detected