MCPcopy Create free account
hub / github.com/XmirrorSecurity/OpenSCA-cli / EncodeElement

Method EncodeElement

opensca/sca/java/xml/marshal.go:184–190  ·  view source on GitHub ↗

EncodeElement writes the XML encoding of v to the stream, using start as the outermost tag in the encoding. See the documentation for Marshal for details about the conversion of Go values to XML. EncodeElement calls Flush before returning.

(v any, start StartElement)

Source from the content-addressed store, hash-verified

182//
183// EncodeElement calls Flush before returning.
184func (enc *Encoder) EncodeElement(v any, start StartElement) error {
185 err := enc.p.marshalValue(reflect.ValueOf(v), nil, &start)
186 if err != nil {
187 return err
188 }
189 return enc.p.w.Flush()
190}
191
192var (
193 begComment = []byte("<!--")

Callers

nothing calls this directly

Calls 2

marshalValueMethod · 0.80
FlushMethod · 0.45

Tested by

no test coverage detected