google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.31k stars 209 forks source link

starlark: require go1.23 for new iterators #551

Closed adonovan closed 4 months ago

adonovan commented 4 months ago

The correct type for new iterators is iter.Seq, which depends on a go1.23-only package, so we must limit the new functions to new toolchains.

In principle this is (yet another) breaking change, but I suspect only users of (pre-)go1.23 will notice, and they are living on the bleeding edge by choice. (Even then, if the iterators are used only as range operands, they will be fine.)

Also, fix a couple of doc links.

jayconrod commented 4 months ago

This PR moves those methods entirely. Do you want to move them into a file that has a //go:build go1.23 constraint that imports and uses iter.Seq? Still an incompatible change, but a less impactful one.

adonovan commented 4 months ago

Thanks for reminding me to git add the new file! ;-)