Starting with go1.23, Go supports using range with custom user types
that satisfy interfaces of the iter package. We can make use of this
functionality for iterating over elements of each type of set.
s := set.From([]int{2, 1, 1, 3})
for item := range s.Items() {
fmt.Println(item)
}
This functionality replaces the need for the ForEach defined on each
set type, and so that method is removed. This means we need a v3 breaking
change for the release.
Starting with
go1.23
, Go supports usingrange
with custom user types that satisfy interfaces of theiter
package. We can make use of this functionality for iterating over elements of each type of set.This functionality replaces the need for the
ForEach
defined on each set type, and so that method is removed. This means we need a v3 breaking change for the release.Closes #82 Part of #90