onsi / gomega

Ginkgo's Preferred Matcher Library
http://onsi.github.io/gomega/
MIT License
2.18k stars 284 forks source link

Use slices from exp/slices to keep golang 1.20 compat #775

Closed gibizer closed 3 months ago

gibizer commented 3 months ago

The #766 introduced dependency to slices but that module is not in the standard lib in golang 1.20.

Closes: #774

liggitt commented 3 months ago

go 1.20 is out of support, adding the dependency on an unstable x/exp module seems worse to me and is blocking some downstreams from updating (xref https://github.com/kubernetes/kubernetes/pull/126787#issuecomment-2311504429)

onsi commented 2 months ago

hey @liggitt - happy to pull this out and cut a new release that also bumps the minimum Go version to 1.22.0 which is in keeping with the Ginko/Gomega last-2-go-versions policy

liggitt commented 2 months ago

it looks like the use is super minimal... maybe we could just delete an item from a slice or find an item in a slice using a simple loop instead of stdlib slices or x/exp use...?

onsi commented 2 months ago

I’ll take a look - but, kinda out of principle, i should be doing a better job of bumping the minimum Go version more consistently to help suss these things out and convey clearly to the community that Ginkgo/Gomega expects you to be on the latest go versions.