MCPcopy
hub / github.com/golang/net / Skip

Method Skip

webdav/internal/xml/read.go:676–691  ·  view source on GitHub ↗

Skip reads tokens until it has consumed the end element matching the most recent start element already consumed. It recurs if it encounters a start element, so it can be used to skip nested structures. It returns nil if it finds an end element matching the start element; otherwise it returns an erro

()

Source from the content-addressed store, hash-verified

674// It returns nil if it finds an end element matching the start
675// element; otherwise it returns an error describing the problem.
676func (d *Decoder) Skip() error {
677 for {
678 tok, err := d.Token()
679 if err != nil {
680 return err
681 }
682 switch tok.(type) {
683 case StartElement:
684 if err := d.Skip(); err != nil {
685 return err
686 }
687 case EndElement:
688 return nil
689 }
690 }
691}

Calls 1

TokenMethod · 0.95