Skip to content

Conversation

ffromani
Copy link
Collaborator

@ffromani ffromani commented Mar 3, 2025

golang 1.21.z already features slices.Contains
(see: https://pkg.go.dev/slices@go1.21.13#Contains) so we can use the stdlib instead of adding a depenency just for a single function.
No intended change in behavior.

@ffromani
Copy link
Collaborator Author

ffromani commented Mar 3, 2025

/cc @jaypipes

@ffromani
Copy link
Collaborator Author

ffromani commented Mar 3, 2025

right, we still support golang 1.18. I 'd write a trivial Contains replacement with a comment to switch to slice.Contains once the minimum supported version is 1.21.
I feel pulling 2 deps for a such trivial code is too much in our case.

reimplement slices.Contains until the minimum supported
version is golang 1.21.

golang 1.21.z already features `slices.Contains`
(see: https://pkg.go.dev/slices@go1.21.13#Contains)
so we can use the stdlib instead of adding a dependency
just for a single function.
No intended change in behavior.

Signed-off-by: Francesco Romani <fromani@redhat.com>
@ffromani ffromani force-pushed the use-slices-contais branch from 7acebef to bba8dfb Compare March 3, 2025 08:22
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

@ffromani works for me! :) thanks!

@jaypipes jaypipes merged commit 8018747 into main Mar 3, 2025
14 checks passed
@jaypipes jaypipes deleted the use-slices-contais branch March 3, 2025 08:35
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.

2 participants