Slice provides some funcs to you to manipulates slice variables. Go1.18+
Go 1.18 and later.
go get github.com/go-laeo/slice
# Contain
slice.Contain([]string{"hello", "world", "slice"}, "hello") // => true
# Chunk
slice.Chunk([]int{1,2,3,4,5}, 2) // => [][]int{{1,2}, {3,4}, {5}}
# Unique
slice.Unique([]string{"go", "go", "golang", "1.18", "1.18", "generics"}) // => []string{"go", "golang", "1.18", "generics"}
Apache 2.0
Any PRs are welcome and appreciated.