mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
feat: add func ContainSubSlice
This commit is contained in:
+3
-1
@@ -6,9 +6,10 @@
|
||||
<div align="center" style="text-align: center;">
|
||||
|
||||

|
||||
[](https://github.com/duke-git/lancet/releases)
|
||||
[](https://github.com/duke-git/lancet/releases)
|
||||
[](https://pkg.go.dev/github.com/duke-git/lancet)
|
||||
[](https://goreportcard.com/report/github.com/duke-git/lancet)
|
||||
[](https://github.com/duke-git/lancet/actions/workflows/codecov.yml)
|
||||
[](https://codecov.io/gh/duke-git/lancet)
|
||||
[](https://github.com/duke-git/lancet/blob/main/LICENSE)
|
||||
|
||||
@@ -394,6 +395,7 @@ func main() {
|
||||
|
||||
```go
|
||||
func Contain[T comparable](slice []T, value T) bool //判断slice是否包含value
|
||||
func ContainSubSlice[T comparable](slice, subslice []T) bool //判断slice是否包含subslice
|
||||
func Chunk[T any](slice []T, size int) [][]T //均分slice
|
||||
func ConvertSlice(originalSlice interface{}, newSliceType reflect.Type) interface{} //将originalSlice转换为 newSliceType
|
||||
func Difference[T comparable](slice1, slice2 []T) []T //返回切片,其元素在slice1中,不在slice2中
|
||||
|
||||
Reference in New Issue
Block a user