“Using the custom iterators actually added in Go 1.23 and writing return func(yield func(int) bool) is a little bit awkward, but it’s much better than needing to pass around close tokens and use them at every call site.”
https://blog.carlana.net/post/2024/golang-reflect-value-seq/