refactor: mark pkg/strings as deprecated in favor of stdlib

This commit is contained in:
Iñaki Segura 2024-11-13 10:17:21 +01:00
parent 1464268851
commit f781442050
6 changed files with 19 additions and 22 deletions

View file

@ -1,10 +1,9 @@
package strings
import "slices"
// Deprecated: Use go slices package instead.
func Contains(list []string, needle string) bool {
for _, item := range list {
if item == needle {
return true
}
}
return false
// TODO(v4): remove package.
return slices.Contains(list, needle)
}