mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-13 17:22:27 +08:00
feat: add func ContainSubSlice
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -393,6 +394,7 @@ func main() {
|
||||
|
||||
```go
|
||||
func Contain[T comparable](slice []T, value T) bool //check if the value is in the slice or not
|
||||
func ContainSubSlice[T comparable](slice, subslice []T) bool //check if the slice contain subslice or not
|
||||
func Chunk[T any](slice []T, size int) [][]T //creates an slice of elements split into groups the length of size.
|
||||
func ConvertSlice(originalSlice interface{}, newSliceType reflect.Type) interface{} //convert originalSlice to newSliceType
|
||||
func Difference[T comparable](slice1, slice2 []T) []T //creates an slice of whose element not included in the other given slice
|
||||
|
||||
Reference in New Issue
Block a user