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

Method unmarshalInterface

opensca/sca/java/xml/read.go:206–223  ·  view source on GitHub ↗

unmarshalInterface unmarshals a single XML element into val. start is the opening tag of the element.

(val Unmarshaler, start *StartElement)

Source from the content-addressed store, hash-verified

204// unmarshalInterface unmarshals a single XML element into val.
205// start is the opening tag of the element.
206func (d *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error {
207 // Record that decoder must stop at end tag corresponding to start.
208 d.pushEOF()
209
210 d.unmarshalDepth++
211 err := val.UnmarshalXML(d, *start)
212 d.unmarshalDepth--
213 if err != nil {
214 d.popEOF()
215 return err
216 }
217
218 if !d.popEOF() {
219 return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local)
220 }
221
222 return nil
223}
224
225// unmarshalTextInterface unmarshals a single XML element into val.
226// The chardata contained in the element (but not its children)

Callers 1

unmarshalMethod · 0.95

Calls 4

pushEOFMethod · 0.95
popEOFMethod · 0.95
receiverTypeFunction · 0.85
UnmarshalXMLMethod · 0.65

Tested by

no test coverage detected