Skip to content

Commit b1c7307

Browse files
committed
Doc: Fix doc comment
1 parent 72158c5 commit b1c7307

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

html/doc.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,11 @@ example, to process each anchor node in depth-first order:
7878
if err != nil {
7979
// ...
8080
}
81-
var f func(*html.Node)
82-
f = func(n *html.Node) {
81+
for n := range doc.All() {
8382
if n.Type == html.ElementNode && n.Data == "a" {
8483
// Do something with n...
8584
}
86-
for c := n.FirstChild; c != nil; c = c.NextSibling {
87-
f(c)
88-
}
8985
}
90-
f(doc)
9186
9287
The relevant specifications include:
9388
https://html.spec.whatwg.org/multipage/syntax.html and

0 commit comments

Comments
 (0)