chore: for backward compatibility (#4852)

Signed-off-by: kevin <wanjunfeng@gmail.com>
This commit is contained in:
Kevin Wan
2025-05-11 20:19:00 +08:00
committed by GitHub
parent 82fe802e81
commit ec989b2e2a
4 changed files with 70 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ var (
ErrInvalidStopPosition = errors.New("stop position is invalid")
)
// Contains checks if str is in list.
// Deprecated: use slices.Contains instead.
func Contains(list []string, str string) bool {
return slices.Contains(list, str)
}
// Filter filters chars from s with given filter function.
func Filter(s string, filter func(r rune) bool) string {
var n int