Right now we have a PR on hold EXPERIMENT: feat: use rangefunc for iterators. It was blocked because github.com/dominikh/go-tools (which golangci-lint uses internally) didn't support range-over-func experiment. But now it does support it, so maybe we should try it.
But there are two problems:
range-over-func feature should be supported in Go 1.22, but they made some adjustments during Go 1.23 dev cycle. Sematics should be the same but implementation may differ.
There was no honnef.co/go/tools release since 22-02-2024 and golangci-lint doesn't use unreleased versions. We can ask Dominik to do a release or can fork golangci-lint and try ourselves.
If we start early we can see where this feature work for us( there are places which are really in need of proper iterators, like working with safe.List is the main thing here). On other hand – it is experiment with all the risks.
Right now we have a PR on hold EXPERIMENT: feat: use rangefunc for iterators. It was blocked because github.com/dominikh/go-tools (which golangci-lint uses internally) didn't support
range-over-func
experiment. But now it does support it, so maybe we should try it.But there are two problems:
range-over-func
feature should be supported in Go 1.22, but they made some adjustments during Go 1.23 dev cycle. Sematics should be the same but implementation may differ.If we start early we can see where this feature work for us( there are places which are really in need of proper iterators, like working with
safe.List
is the main thing here). On other hand – it is experiment with all the risks.