Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starlark: require go1.23 for new iterators #551

Merged
merged 1 commit into from
May 17, 2024
Merged

starlark: require go1.23 for new iterators #551

merged 1 commit into from
May 17, 2024

Conversation

adonovan
Copy link
Collaborator

@adonovan adonovan commented May 16, 2024

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.

@adonovan adonovan requested a review from jayconrod May 16, 2024 17:26
@jayconrod
Copy link
Collaborator

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
Copy link
Collaborator Author

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

Copy link
Collaborator

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes more sense, looks good. And iterator_test.go already has //go:build go1.23 so nothing changes there.

starlark/iter.go Outdated Show resolved Hide resolved
starlark/iter.go Outdated Show resolved Hide resolved
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.

Also, fix a couple of doc links.
@adonovan adonovan merged commit 3792562 into master May 17, 2024
27 checks passed
@adonovan adonovan deleted the iter-tag branch May 17, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants