package xslices
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xslices"
Index ¶
- func Clone[S ~[]E, E any](s S) S
- func Diff[T any](from, to []T, cmp func(lhs, rhs T) int) (steady, added, dropped []T)
- func Filter[T any](x []T, filter func(t T) bool) (good, bad []T)
- func Map[Key comparable, T any](x []T, key func(t T) Key) map[Key]T
- func Sort[T any](in []T, cmp func(lhs, rhs T) int)
- func SortCopy[T any](in []T, cmp func(lhs, rhs T) int) (out []T)
- func Transform[T1, T2 any](in []T1, f func(t T1) T2) (out []T2)
Functions ¶
func Clone ¶
func Clone[S ~[]E, E any](s S) S
Clone returns a copy of the slice. The elements are copied using assignment, so this is a shallow clone.
func Diff ¶
func Filter ¶
func Map ¶
func Map[Key comparable, T any](x []T, key func(t T) Key) map[Key]T
func Sort ¶
func SortCopy ¶
func Transform ¶
func Transform[T1, T2 any](in []T1, f func(t T1) T2) (out []T2)
Source Files ¶
clone.go diff.go map.go sort.go sort_copy.go split.go transform.go
- Version
- v3.75.2
- Published
- Jul 17, 2024
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 minute ago –
Tools for package owners.