Documentation ¶
Overview ¶
Package slices contains functions to operate on slices treated as sets.
Index ¶
- func BytesToStrings(a [][]byte) []string
- func CompareSlice(a, b [][]byte) int
- func CopyChunkedByteSlices(src [][]byte, chunkSize int) [][]byte
- func Exists(set []string, find string) bool
- func ExistsIgnoreCase(set []string, find string) bool
- func MergeSortedBytes(n ...[][]byte) [][]byte
- func MergeSortedFloats(n ...[]float64) []float64
- func MergeSortedInts(n ...[]int64) []int64
- func MergeSortedStrings(n ...[]string) []string
- func MergeSortedUInts(n ...[]uint64) []uint64
- func StringsToBytes(s ...string) [][]byte
- func Union(setA, setB []string, ignoreCase bool) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToStrings ¶
BytesToStrings converts a slice of []byte into a slice of strings.
func CompareSlice ¶
CompareSlice returns an integer comparing two slices of byte slices lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.
func CopyChunkedByteSlices ¶
CopyChunkedByteSlices deep-copies a [][]byte to a new [][]byte that is backed by a small number of []byte "chunks".
func ExistsIgnoreCase ¶
ExistsIgnoreCase checks if a string is in a set but ignores its case.
func MergeSortedBytes ¶
Merge uses a k-way merge to merge n collections of sorted byte slices.
The resulting slice is returned in ascending order, with any duplicate values removed.
func MergeSortedFloats ¶
Merge uses a k-way merge to merge n collections of sorted byte slices.
The resulting slice is returned in ascending order, with any duplicate values removed.
func MergeSortedInts ¶
Merge uses a k-way merge to merge n collections of sorted byte slices.
The resulting slice is returned in ascending order, with any duplicate values removed.
func MergeSortedStrings ¶
Merge uses a k-way merge to merge n collections of sorted byte slices.
The resulting slice is returned in ascending order, with any duplicate values removed.
func MergeSortedUInts ¶
Merge uses a k-way merge to merge n collections of sorted byte slices.
The resulting slice is returned in ascending order, with any duplicate values removed.
func StringsToBytes ¶
StringsToBytes converts a variable number of strings into a slice of []byte.
Types ¶
This section is empty.