siderolabs / omni

SaaS-simple deployment of Kubernetes - on your own hardware.
Other
397 stars 23 forks source link

Investigate if we can integrate `range-over-func` ahead of Go 1.23 release #306

Open DmitriyMV opened 1 month ago

DmitriyMV commented 1 month ago

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:

  1. 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.
  2. 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.

smira commented 1 month ago

Let's wait for 1.23 release