1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-14 01:32:27 +08:00

feat: add ContainAny (#338)

Co-authored-by: Jiawen <im@linjiawen.com>
This commit is contained in:
Javen
2025-10-30 19:24:45 +08:00
committed by GitHub
parent fc624195c7
commit 350450bb67
7 changed files with 161 additions and 0 deletions

View File

@@ -58,6 +58,24 @@ func ExampleContainSubSlice() {
// false
}
func ExampleContainAny() {
result1 := ContainAny([]string{"a", "b", "c"}, []string{"a"})
result2 := ContainAny([]string{"a", "b", "c"}, []string{"d", "e"})
result3 := ContainAny([]string{"a", "b", "c"}, []string{"d", "a"})
result4 := ContainAny([]string{"a", "b", "c"}, []string{})
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// true
// false
// true
// false
}
func ExampleChunk() {
arr := []string{"a", "b", "c", "d", "e"}