Skip to content

Commit

Permalink
doc:update
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoK29 committed Jun 30, 2023
1 parent 7ca320c commit 296bc36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func RandomOne[T any](arr []T) T
func Unique[T ~string | comdef.XintOrFloat](list []T) []T
func IndexOf[T ~string | comdef.XintOrFloat](val T, list []T) int
// source at arrutil/check.go
func SliceHas[T comdef.ScalarType](slice []T, val T) bool
func IntsHas(ints []int, val int) bool
func Int64sHas(ints []int64, val int64) bool
func InStrings(elem string, ss []string) bool
Expand Down Expand Up @@ -164,6 +165,10 @@ arrutil.IntsHas([]int{2, 4, 5}, 2) // True
arrutil.Int64sHas([]int64{2, 4, 5}, 2) // True
arrutil.StringsHas([]string{"a", "b"}, "a") // True

arrutil.SliceHas([]int{2, 4, 5}, 2) // True
arrutil.SliceHas([]int64{2, 4, 5}, 2) // True
arrutil.SliceHas([]string{"a", "b"}, "a") // True

// list and val interface{}
arrutil.Contains(list, val)
arrutil.Contains([]uint32{9, 2, 3}, 9) // True
Expand Down
5 changes: 5 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func RandomOne[T any](arr []T) T
func Unique[T ~string | comdef.XintOrFloat](list []T) []T
func IndexOf[T ~string | comdef.XintOrFloat](val T, list []T) int
// source at arrutil/check.go
func SliceHas[T comdef.ScalarType](slice []T, val T) bool
func IntsHas(ints []int, val int) bool
func Int64sHas(ints []int64, val int64) bool
func InStrings(elem string, ss []string) bool
Expand Down Expand Up @@ -163,6 +164,10 @@ arrutil.IntsHas([]int{2, 4, 5}, 2) // True
arrutil.Int64sHas([]int64{2, 4, 5}, 2) // True
arrutil.StringsHas([]string{"a", "b"}, "a") // True

arrutil.SliceHas([]int{2, 4, 5}, 2) // True
arrutil.SliceHas([]int64{2, 4, 5}, 2) // True
arrutil.SliceHas([]string{"a", "b"}, "a") // True

// list and val interface{}
arrutil.Contains(list, val)
arrutil.Contains([]uint32{9, 2, 3}, 9) // True
Expand Down

0 comments on commit 296bc36

Please sign in to comment.