refactor: mark pkg/strings as deprecated in favor of stdlib (#680)
* refactor: mark pkg/strings as deprecated in favor of stdlib * format: reword deprecate notice and use doc links
This commit is contained in:
parent
1464268851
commit
6d20928028
6 changed files with 19 additions and 22 deletions
|
@ -1,10 +1,9 @@
|
|||
package strings
|
||||
|
||||
import "slices"
|
||||
|
||||
// Deprecated: Use standard library [slices.Contains] 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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue