Skip to content

Commit

Permalink
Bring back the mutant warning
Browse files Browse the repository at this point in the history
  • Loading branch information
earthboundkid committed Aug 29, 2024
1 parent d83f464 commit baf2028
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions html/iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func (n *Node) Ancestors() iter.Seq[*Node] {
// Example:
//
// for child := range n.Children() { ... }
//
// Mutating a Node or its children while iterating may have unexpected results.
func (n *Node) Children() iter.Seq[*Node] {
_ = n.FirstChild // eager nil check

Expand All @@ -46,6 +48,8 @@ func (n *Node) Children() iter.Seq[*Node] {
// Example:
//
// for desc := range n.Descendants() { ... }
//
// Mutating a Node or its descendants while iterating may have unexpected results.
func (n *Node) Descendants() iter.Seq[*Node] {
_ = n.FirstChild // eager nil check

Expand Down

0 comments on commit baf2028

Please sign in to comment.