MCPcopy Index your code
hub / github.com/XmirrorSecurity/OpenSCA-cli / Skip

Method Skip

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

Skip reads tokens until it has consumed the end element matching the most recent start element already consumed, skipping nested structures. It returns nil if it finds an end element matching the start element; otherwise it returns an error describing the problem.

()

Source from the content-addressed store, hash-verified

772// It returns nil if it finds an end element matching the start
773// element; otherwise it returns an error describing the problem.
774func (d *Decoder) Skip() error {
775 var depth int64
776 for {
777 tok, err := d.Token()
778 if err != nil {
779 return err
780 }
781 switch tok.(type) {
782 case StartElement:
783 depth++
784 case EndElement:
785 if depth == 0 {
786 return nil
787 }
788 depth--
789 }
790 }
791}

Callers 2

unmarshalMethod · 0.95
unmarshalPathMethod · 0.95

Calls 1

TokenMethod · 0.95

Tested by

no test coverage detected