aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2012-02-07 16:15:35 +1100
committerRob Pike <r@golang.org>2012-02-07 16:15:35 +1100
commit749f228cbd413da4f9ae0ea28c5271f3a45c3c1f (patch)
treed41aca9f094877977d3238fa7eadeab5d4330eb1
parent38b8f6c7a427978968452234e10c0b214b862c8c (diff)
downloadgo-749f228cbd413da4f9ae0ea28c5271f3a45c3c1f.tar.gz
go-749f228cbd413da4f9ae0ea28c5271f3a45c3c1f.zip
encoding/xml: fix documentation for Decoder.Skip
Fixes #2850. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5645043
-rw-r--r--src/pkg/encoding/xml/read.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/pkg/encoding/xml/read.go b/src/pkg/encoding/xml/read.go
index 6a8f5afee7..bde875a012 100644
--- a/src/pkg/encoding/xml/read.go
+++ b/src/pkg/encoding/xml/read.go
@@ -542,10 +542,12 @@ Loop:
panic("unreachable")
}
-// Have already read a start element.
-// Read tokens until we find the end element.
-// Token is taking care of making sure the
-// end element matches the start element we saw.
+// 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 error describing the problem.
func (d *Decoder) Skip() error {
for {
tok, err := d.Token()