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

Method marshalDoc

encode.go:94–109  ·  view source on GitHub ↗
(tag string, in reflect.Value)

Source from the content-addressed store, hash-verified

92}
93
94func (e *encoder) marshalDoc(tag string, in reflect.Value) {
95 e.init()
96 var node *Node
97 if in.IsValid() {
98 node, _ = in.Interface().(*Node)
99 }
100 if node != nil && node.Kind == DocumentNode {
101 e.nodev(in)
102 } else {
103 yaml_document_start_event_initialize(&e.event, nil, nil, true)
104 e.emit()
105 e.marshal(tag, in)
106 yaml_document_end_event_initialize(&e.event, true)
107 e.emit()
108 }
109}
110
111func (e *encoder) marshal(tag string, in reflect.Value) {
112 tag = shortTag(tag)

Callers 3

MarshalFunction · 0.80
EncodeMethod · 0.80
EncodeMethod · 0.80

Calls 6

initMethod · 0.95
nodevMethod · 0.95
emitMethod · 0.95
marshalMethod · 0.95

Tested by

no test coverage detected