Skip to content

Commit e8797ff

Browse files
committed
add warning to Node.Parents
1 parent 13a4d2c commit e8797ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

html/iter.go

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ func (n *Node) All() iter.Seq[*Node] {
5151
}
5252

5353
// Parents returns an sequence yielding the node and its parents.
54+
//
55+
// Mutating a Node while iterating through it or its parents may have unexpected results.
5456
func (n *Node) Parents() iter.Seq[*Node] {
5557
return func(yield func(*Node) bool) {
5658
for p := n; p != nil; p = p.Parent {

0 commit comments

Comments
 (0)