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

pkg: replace utils/strings/InSlice func with slices.Contains #413

Merged

Conversation

mohamedawnallah
Copy link
Contributor

Description

In this commit, we replace utils/strings/InSlice function with the built-in slices.Contains function which is supported in go 1.18+ and it would work with the current project go version 1.19 as appears in the go.mod file.

Closes #245

How has this been tested?

I've run the test cases using make test and all of them passed.

@CLAassistant
Copy link

CLAassistant commented Jun 28, 2024

CLA assistant check
All committers have signed the CLA.

In this commit, we replace `utils/strings/InSlice` function
with the built-in `slices.Contains` function which is supported
in go 1.18+ and it would work with the current project go version
`1.19`.

Signed-off-by: Mohamed Awnallah <[email protected]>
@mohamedawnallah mohamedawnallah force-pushed the replaceInSliceWithSlicesContains branch from cd0720f to a7c398a Compare June 28, 2024 20:15
@knqyf263
Copy link
Collaborator

knqyf263 commented Jul 1, 2024

I think slices was added to the standard package in Go 1.21.

@mohamedawnallah
Copy link
Contributor Author

Ah sorry my bad. Your are right:
https://pkg.go.dev/slices?tab=versions

@knqyf263
Copy link
Collaborator

knqyf263 commented Jul 1, 2024

opened #415

@knqyf263 knqyf263 merged commit 5d13607 into aquasecurity:main Jul 1, 2024
2 checks passed
@knqyf263
Copy link
Collaborator

knqyf263 commented Jul 1, 2024

Thanks

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.

replace utils/strings/InSlice to slices.Contains
3 participants