puzpuzpuz/xsync

Support Go 1.23 Iterators

Closed this issue · 3 comments

This would allow the Range() function on Map to be depricated

This already works.
Thanks

What do you mean? It works how?

You mean like this?

for k, v := range iter.Seq2[K, V](xsyncmap.Range) {
    ...
}

This works, but would be nice to have a dedicated function yielding a better syntax.

for k, v := range syncmap.Range {
    ...
}

also works, as Range already has the right signature.