aquasecurity / trivy-db

Apache License 2.0
215 stars 131 forks source link

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

Closed mohamedawnallah closed 2 months ago

mohamedawnallah commented 2 months ago

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 commented 2 months ago

CLA assistant check
All committers have signed the CLA.

knqyf263 commented 2 months ago

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

mohamedawnallah commented 2 months ago

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

knqyf263 commented 2 months ago

opened https://github.com/aquasecurity/trivy-db/pull/415

knqyf263 commented 2 months ago

Thanks