Documentation ¶
Index ¶
- func Abs[T constraints.Integer | constraints.Float](val T) T
- func All[T any](ss []T, fn func(value T) bool) bool
- func Any[T any](ss []T, fn func(value T) bool) bool
- func AreSorted[T constraints.Ordered](ss []T) bool
- func AreUnique[T comparable](ss []T) bool
- func Average[T constraints.Integer | constraints.Float](ss []T) float64
- func Bottom[T any](ss []T, n int) (top []T)
- func Chunk[T any](ss []T, chunkLength int) [][]T
- func Contains[T comparable](ss []T, lookingFor T) bool
- func Delete[T any](ss []T, idx ...int) []T
- func Diff[T comparable](ss []T, against []T) (added, removed []T)
- func DropTop[T any](ss []T, n int) (drop []T)
- func DropWhile[T comparable](ss []T, f func(s T) bool) (ss2 []T)
- func Each[T any](ss []T, fn func(T)) []T
- func Equals[T comparable](ss []T, rhs []T) bool
- func Filter[T any](ss []T, condition func(T) bool) (ss2 []T)
- func FilterNot[T any](ss []T, condition func(T) bool) (ss2 []T)
- func FindFirstUsing[T any](ss []T, fn func(value T) bool) int
- func First[T any](ss []T) T
- func FirstOr[T any](ss []T, defaultValue T) T
- func Flat[T any](ss [][]T) (ss2 []T)
- func Float64[T constraints.Ordered](x T) float64
- func Float64s[T constraints.Ordered](ss []T) []float64
- func Group[T comparable](ss []T) map[T]int
- func GroupBy[T comparable, U any](values []U, getKey func(U) T) map[T][]U
- func Insert[T any](ss []T, index int, values ...T) []T
- func Int[T constraints.Ordered](x T) int
- func Intersect[T comparable](ss []T, slices ...[]T) (ss2 []T)
- func Ints[T constraints.Ordered](ss []T) []int
- func JSONBytes[T constraints.Ordered](ss []T) []byte
- func JSONBytesIndent[T constraints.Ordered](ss []T, prefix, indent string) []byte
- func JSONString[T constraints.Ordered](ss []T) string
- func JSONStringIndent[T constraints.Ordered](ss []T, prefix, indent string) string
- func Join[T constraints.Ordered](ss []T, glue string) (s string)
- func Keys[K comparable, V any](m map[K]V) []K
- func Last[T any](ss []T) T
- func LastOr[T any](ss []T, defaultValue T) T
- func Map[T any, U any](ss []T, fn func(T) U) (ss2 []U)
- func Max[T constraints.Ordered](ss []T) (max T)
- func Median[T constraints.Integer | constraints.Float](ss []T) T
- func Min[T constraints.Ordered](ss []T) (min T)
- func Mode[T comparable](ss []T) []T
- func Pop[T any](ss *[]T) (popped *T)
- func Product[T constraints.Integer | constraints.Float](ss []T) (product T)
- func Random[T constraints.Integer | constraints.Float](ss []T, source rand.Source) T
- func Reduce[T any](ss []T, reducer func(T, T) T) (el T)
- func Reverse[T any](ss []T) []T
- func Rotate[T any](ss []T, n int) []T
- func Send[T any](ctx context.Context, ss []T, ch chan<- T) []T
- func Sequence[T constraints.Integer | constraints.Float](ss []T, params ...int) []T
- func SequenceUsing[T any](ss []T, creator func(int) T, params ...int) []T
- func Shift[T any](ss []T) (T, []T)
- func Shuffle[T any](ss []T, source rand.Source) []T
- func Sort[T constraints.Ordered](ss []T) []T
- func SortStableUsing[T comparable](ss []T, less func(a, b T) bool) []T
- func SortUsing[T any](ss []T, less func(a, b T) bool) []T
- func Stddev[T constraints.Integer | constraints.Float](ss []T) float64
- func String[T constraints.Ordered](s T) string
- func Strings[T constraints.Ordered](ss []T) []string
- func StringsUsing[T any](ss []T, transform func(T) string) []string
- func SubSlice[T any](ss []T, start int, end int) (subSlice []T)
- func Sum[T constraints.Integer | constraints.Float](ss []T) (sum T)
- func Top[T any](ss []T, n int) (top []T)
- func Unique[T comparable](ss []T) []T
- func UniqueStable[T comparable](ss []T) []T
- func Unshift[T any](ss []T, elements ...T) (unshift []T)
- func Values[K comparable, V any](m map[K]V) []V
- type OfNumericSlice
- func (o OfNumericSlice[T]) All(fn func(value T) bool) bool
- func (o OfNumericSlice[T]) Any(fn func(value T) bool) bool
- func (o OfNumericSlice[T]) AreSorted() bool
- func (o OfNumericSlice[T]) AreUnique() bool
- func (o OfNumericSlice[T]) Average() float64
- func (o OfNumericSlice[T]) Bottom(n int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Contains(lookingFor T) bool
- func (o OfNumericSlice[T]) Delete(idx ...int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Diff(against []T) ([]T, []T)
- func (o OfNumericSlice[T]) DropTop(n int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) DropWhile(f func(s T) bool) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Each(fn func(T)) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Equals(rhs []T) bool
- func (o OfNumericSlice[T]) Filter(condition func(T) bool) OfNumericSlice[T]
- func (o OfNumericSlice[T]) FilterNot(condition func(T) bool) OfNumericSlice[T]
- func (o OfNumericSlice[T]) FindFirstUsing(fn func(value T) bool) int
- func (o OfNumericSlice[T]) First() T
- func (o OfNumericSlice[T]) FirstOr(defaultValue T) T
- func (o OfNumericSlice[T]) Float64s() []float64
- func (o OfNumericSlice[T]) Group() map[T]int
- func (o OfNumericSlice[T]) Insert(index int, values ...T) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Intersect(slices ...[]T) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Ints() []int
- func (o OfNumericSlice[T]) JSONBytes() []byte
- func (o OfNumericSlice[T]) JSONBytesIndent(prefix, indent string) []byte
- func (o OfNumericSlice[T]) JSONString() string
- func (o OfNumericSlice[T]) JSONStringIndent(prefix, indent string) string
- func (o OfNumericSlice[T]) Join(glue string) string
- func (o OfNumericSlice[T]) Last() T
- func (o OfNumericSlice[T]) LastOr(defaultValue T) T
- func (o OfNumericSlice[T]) Map(fn func(T) T) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Max() T
- func (o OfNumericSlice[T]) Median() T
- func (o OfNumericSlice[T]) Min() T
- func (o OfNumericSlice[T]) Mode() OfNumericSlice[T]
- func (o OfNumericSlice[T]) Product() T
- func (o OfNumericSlice[T]) Random(source rand.Source) T
- func (o OfNumericSlice[T]) Reduce(reducer func(T, T) T) T
- func (o OfNumericSlice[T]) Reverse() OfNumericSlice[T]
- func (o OfNumericSlice[T]) Send(ctx context.Context, ch chan<- T) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Sequence(params ...int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) SequenceUsing(creator func(int) T, params ...int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Shuffle(source rand.Source) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Sort() OfNumericSlice[T]
- func (o OfNumericSlice[T]) SortStableUsing(less func(a, b T) bool) OfNumericSlice[T]
- func (o OfNumericSlice[T]) SortUsing(less func(a, b T) bool) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Stddev() float64
- func (o OfNumericSlice[T]) Strings() []string
- func (o OfNumericSlice[T]) StringsUsing(transform func(T) string) []string
- func (o OfNumericSlice[T]) SubSlice(start int, end int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Sum() T
- func (o OfNumericSlice[T]) Top(n int) OfNumericSlice[T]
- func (o OfNumericSlice[T]) Unique() OfNumericSlice[T]
- func (o OfNumericSlice[T]) UniqueStable() OfNumericSlice[T]
- func (o OfNumericSlice[T]) Unshift(elements ...T) OfNumericSlice[T]
- type OfOrderedSlice
- func (o OfOrderedSlice[T]) All(fn func(value T) bool) bool
- func (o OfOrderedSlice[T]) Any(fn func(value T) bool) bool
- func (o OfOrderedSlice[T]) AreSorted() bool
- func (o OfOrderedSlice[T]) AreUnique() bool
- func (o OfOrderedSlice[T]) Bottom(n int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Contains(lookingFor T) bool
- func (o OfOrderedSlice[T]) Delete(idx ...int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Diff(against []T) ([]T, []T)
- func (o OfOrderedSlice[T]) DropTop(n int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) DropWhile(f func(s T) bool) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Each(fn func(T)) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Equals(rhs []T) bool
- func (o OfOrderedSlice[T]) Filter(condition func(T) bool) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) FilterNot(condition func(T) bool) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) FindFirstUsing(fn func(value T) bool) int
- func (o OfOrderedSlice[T]) First() T
- func (o OfOrderedSlice[T]) FirstOr(defaultValue T) T
- func (o OfOrderedSlice[T]) Float64s() []float64
- func (o OfOrderedSlice[T]) Group() map[T]int
- func (o OfOrderedSlice[T]) Insert(index int, values ...T) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Intersect(slices ...[]T) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Ints() []int
- func (o OfOrderedSlice[T]) JSONBytes() []byte
- func (o OfOrderedSlice[T]) JSONBytesIndent(prefix, indent string) []byte
- func (o OfOrderedSlice[T]) JSONString() string
- func (o OfOrderedSlice[T]) JSONStringIndent(prefix, indent string) string
- func (o OfOrderedSlice[T]) Join(glue string) string
- func (o OfOrderedSlice[T]) Last() T
- func (o OfOrderedSlice[T]) LastOr(defaultValue T) T
- func (o OfOrderedSlice[T]) Map(fn func(T) T) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Max() T
- func (o OfOrderedSlice[T]) Min() T
- func (o OfOrderedSlice[T]) Mode() OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Reverse() OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Send(ctx context.Context, ch chan<- T) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) SequenceUsing(creator func(int) T, params ...int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Shuffle(source rand.Source) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Sort() OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) SortStableUsing(less func(a, b T) bool) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) SortUsing(less func(a, b T) bool) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Strings() []string
- func (o OfOrderedSlice[T]) StringsUsing(transform func(T) string) []string
- func (o OfOrderedSlice[T]) SubSlice(start int, end int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Top(n int) OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Unique() OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) UniqueStable() OfOrderedSlice[T]
- func (o OfOrderedSlice[T]) Unshift(elements ...T) OfOrderedSlice[T]
- type OfSlice
- func (o OfSlice[T]) All(fn func(value T) bool) bool
- func (o OfSlice[T]) Any(fn func(value T) bool) bool
- func (o OfSlice[T]) Bottom(n int) OfSlice[T]
- func (o OfSlice[T]) Delete(idx ...int) OfSlice[T]
- func (o OfSlice[T]) DropTop(n int) OfSlice[T]
- func (o OfSlice[T]) Each(fn func(T)) OfSlice[T]
- func (o OfSlice[T]) Filter(condition func(T) bool) OfSlice[T]
- func (o OfSlice[T]) FilterNot(condition func(T) bool) OfSlice[T]
- func (o OfSlice[T]) FindFirstUsing(fn func(value T) bool) int
- func (o OfSlice[T]) First() T
- func (o OfSlice[T]) FirstOr(defaultValue T) T
- func (o OfSlice[T]) Insert(index int, values ...T) OfSlice[T]
- func (o OfSlice[T]) Last() T
- func (o OfSlice[T]) LastOr(defaultValue T) T
- func (o OfSlice[T]) Map(fn func(T) T) OfSlice[T]
- func (o OfSlice[T]) Reverse() OfSlice[T]
- func (o OfSlice[T]) Rotate(n int) OfSlice[T]
- func (o OfSlice[T]) Send(ctx context.Context, ch chan<- T) OfSlice[T]
- func (o OfSlice[T]) SequenceUsing(creator func(int) T, params ...int) OfSlice[T]
- func (o OfSlice[T]) Shuffle(source rand.Source) OfSlice[T]
- func (o OfSlice[T]) SortUsing(less func(a, b T) bool) OfSlice[T]
- func (o OfSlice[T]) StringsUsing(transform func(T) string) []string
- func (o OfSlice[T]) SubSlice(start int, end int) OfSlice[T]
- func (o OfSlice[T]) Top(n int) OfSlice[T]
- func (o OfSlice[T]) Unshift(elements ...T) OfSlice[T]
- type Zipped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer | constraints.Float](val T) T
Abs returns the absolute value.
func All ¶
All will return true if all callbacks return true. It follows the same logic as the all() function in Python.
If the list is empty then true is always returned.
func Any ¶
Any will return true if any callbacks return true. It follows the same logic as the any() function in Python.
If the list is empty then false is always returned.
func AreSorted ¶
func AreSorted[T constraints.Ordered](ss []T) bool
AreSorted will return true if the slice is already sorted. It is a wrapper for sort.SliceIsSorted.
func AreUnique ¶
func AreUnique[T comparable](ss []T) bool
AreUnique will return true if the slice contains elements that are all different (unique) from each other.
func Average ¶
func Average[T constraints.Integer | constraints.Float](ss []T) float64
Average is the average of all of the elements, or zero if there are no elements.
func Bottom ¶
Bottom will return n elements from bottom
that means that elements is taken from the end of the slice for this [1,2,3] slice with n == 2 will be returned [3,2] if the slice has less elements then n that'll return all elements if n < 0 it'll return empty slice.
func Chunk ¶ added in v2.3.0
Chunk splits the input and returns multi slices whose length equals chunkLength, except for the last slice which may contain fewer elements.
Examples:
Chunk([1, 2, 3], 4) => [ [1, 2, 3] ] Chunk([1, 2, 3], 3) => [ [1, 2, 3] ] Chunk([1, 2, 3], 2) => [ [1, 2], [3] ] Chunk([1, 2, 3], 1) => [ [1], [2], [3] ] Chunk([], 1) => [ [] ] Chunk([1, 2, 3], 0) => panic: chunkLength should be greater than 0
func Contains ¶
func Contains[T comparable](ss []T, lookingFor T) bool
Contains returns true if the element exists in the slice.
When using slices of pointers it will only compare by address, not value.
func Delete ¶ added in v2.7.0
Removes elements at indices in idx from input slice, returns resulting slice. If an index is out of bounds, skip it.
func Diff ¶
func Diff[T comparable](ss []T, against []T) (added, removed []T)
Diff returns the elements that needs to be added or removed from the first slice to have the same elements in the second slice.
The order of elements is not taken into consideration, so the slices are treated sets that allow duplicate items.
The added and removed returned may be blank respectively, or contain upto as many elements that exists in the largest slice.
func DropTop ¶
DropTop will return the rest slice after dropping the top n elements if the slice has less elements then n that'll return empty slice if n < 0 it'll return empty slice.
func DropWhile ¶
func DropWhile[T comparable](ss []T, f func(s T) bool) (ss2 []T)
Drop items from the slice while f(item) is true. Afterwards, return every element until the slice is empty. It follows the same logic as the dropwhile() function from itertools in Python.
func Each ¶
func Each[T any](ss []T, fn func(T)) []T
Each is more condensed version of Transform that allows an action to happen on each elements and pass the original slice on.
pie.Each(cars, func (car *Car) { fmt.Printf("Car color is: %s\n", car.Color) })
Pie will not ensure immutability on items passed in so they can be manipulated, if you choose to do it this way, for example:
// Set all car colors to Red. pie.Each(cars, func (car *Car) { car.Color = "Red" })
func Equals ¶
func Equals[T comparable](ss []T, rhs []T) bool
Equals compare elements from the start to the end,
if they are the same is considered the slices are equal if all elements are the same is considered the slices are equal if each slice == nil is considered that they're equal
if element realizes Equals interface it uses that method, in other way uses default compare
func Filter ¶
Filter will return a new slice containing only the elements that return true from the condition. The returned slice may contain zero elements (nil).
FilterNot works in the opposite way of Filter.
func FilterNot ¶
FilterNot works the same as Filter, with a negated condition. That is, it will return a new slice only containing the elements that returned false from the condition. The returned slice may contain zero elements (nil).
func FindFirstUsing ¶
FindFirstUsing will return the index of the first element when the callback returns true or -1 if no element is found. It follows the same logic as the findIndex() function in Javascript.
If the list is empty then -1 is always returned.
func First ¶ added in v2.1.0
func First[T any](ss []T) T
First returns the first element or a zero value if there are no elements.
func FirstOr ¶
func FirstOr[T any](ss []T, defaultValue T) T
FirstOr returns the first element or a default value if there are no elements.
func Flat ¶ added in v2.4.0
func Flat[T any](ss [][]T) (ss2 []T)
Flat flattens the two-dimensional slice into one-dimensional slice. Slices of zero-length are ignored.
Examples:
Flat([[100], [101, 102], [102, 103]]) => [100, 101, 102, 102, 103] Flat([nil, [101, 102], []]) => [101, 102]
func Float64 ¶
func Float64[T constraints.Ordered](x T) float64
Float64 transforms a value into a float64. This should only be used on slices that resolve to strings that represent numbers. An invalid value will use zero.
func Float64s ¶
func Float64s[T constraints.Ordered](ss []T) []float64
Float64s transforms each element to a float64.
func Group ¶
func Group[T comparable](ss []T) map[T]int
Group returns a map of the value with an individual count.
func GroupBy ¶ added in v2.5.0
func GroupBy[T comparable, U any](values []U, getKey func(U) T) map[T][]U
GroupBy groups slice elements by key returned by getKey function for each slice element.
It returns a map in which slices of elements of original slice are matched to keys defined by getKey function. It returns non-nil map, if empty or nil slice is passed.
For example, if you want to group integers by their remainder from division by 5, you can use this function as follows:
_ = pie.GroupBy( []int{23, 76, 37, 11, 23, 47}, func(num int) int { return num % 5 }, )
In above case map {1:[76, 11], 2:[37, 47], 3:[23, 23]} is returned.
func Int ¶
func Int[T constraints.Ordered](x T) int
Int transforms a value into an int. This should only be used on slices that resolve to strings that represent numbers. An invalid value will use zero and fractional values will be truncated.
func Intersect ¶
func Intersect[T comparable](ss []T, slices ...[]T) (ss2 []T)
Intersect returns items that exist in all lists.
It returns slice without any duplicates. If zero slice arguments are provided, then nil is returned.
func Ints ¶
func Ints[T constraints.Ordered](ss []T) []int
Ints transforms each element to an integer.
func JSONBytes ¶
func JSONBytes[T constraints.Ordered](ss []T) []byte
JSONBytes returns the JSON encoded array as bytes.
One important thing to note is that it will treat a nil slice as an empty slice to ensure that the JSON value return is always an array.
func JSONBytesIndent ¶
func JSONBytesIndent[T constraints.Ordered](ss []T, prefix, indent string) []byte
JSONBytesIndent returns the JSON encoded array as bytes with indent applied.
One important thing to note is that it will treat a nil slice as an empty slice to ensure that the JSON value return is always an array. See json.MarshalIndent for details.
func JSONString ¶
func JSONString[T constraints.Ordered](ss []T) string
JSONString returns the JSON encoded array as a string.
One important thing to note is that it will treat a nil slice as an empty slice to ensure that the JSON value return is always an array.
func JSONStringIndent ¶
func JSONStringIndent[T constraints.Ordered](ss []T, prefix, indent string) string
JSONStringIndent returns the JSON encoded array as a string with indent applied.
One important thing to note is that it will treat a nil slice as an empty slice to ensure that the JSON value return is always an array. See json.MarshalIndent for details.
func Join ¶
func Join[T constraints.Ordered](ss []T, glue string) (s string)
Join returns a string from joining each of the elements.
func Keys ¶
func Keys[K comparable, V any](m map[K]V) []K
Keys returns the keys in the map. All of the items will be unique.
Due to Go's randomization of iterating maps the order is not deterministic.
func Last ¶ added in v2.1.0
func Last[T any](ss []T) T
Last returns the last element or a zero value if there are no elements.
func LastOr ¶
func LastOr[T any](ss []T, defaultValue T) T
LastOr returns the last element or a default value if there are no elements.
func Map ¶
Map will return a new slice where each element has been mapped (transformed). The number of elements returned will always be the same as the input.
Be careful when using this with slices of pointers. If you modify the input value it will affect the original slice. Be sure to return a new allocated object or deep copy the existing one.
func Median ¶
func Median[T constraints.Integer | constraints.Float](ss []T) T
Median returns the value separating the higher half from the lower half of a data sample.
Zero is returned if there are no elements in the slice.
If the number of elements is even, then the ElementType mean of the two "median values" is returned.
func Mode ¶
func Mode[T comparable](ss []T) []T
Mode returns a new slice containing the most frequently occuring values.
The number of items returned may be the same as the input or less. It will never return zero items unless the input slice has zero items.
func Pop ¶
func Pop[T any](ss *[]T) (popped *T)
Pop the first element of the slice
Usage Example:
type knownGreetings []string greetings := knownGreetings{"ciao", "hello", "hola"} for greeting := greetings.Pop(); greeting != nil; greeting = greetings.Pop() { fmt.Println(*greeting) }
func Product ¶
func Product[T constraints.Integer | constraints.Float](ss []T) (product T)
Product is the product of all of the elements.
func Random ¶
func Random[T constraints.Integer | constraints.Float](ss []T, source rand.Source) T
Random returns a random element by your rand.Source, or zero.
func Reduce ¶
func Reduce[T any](ss []T, reducer func(T, T) T) (el T)
Reduce continually applies the provided function over the slice. Reducing the elements to a single value.
Returns a zero value of T if there are no elements in the slice. It will panic if the reducer is nil and the slice has more than one element (required to invoke reduce). Otherwise returns result of applying reducer from left to right.
func Reverse ¶
func Reverse[T any](ss []T) []T
Reverse returns a new copy of the slice with the elements ordered in reverse. This is useful when combined with Sort to get a descending sort order:
ss.Sort().Reverse()
func Rotate ¶ added in v2.8.0
Rotate return slice circularly rotated by a number of positions n. If n is positive, the slice is rotated right. If n is negative, the slice is rotated left.
func Send ¶
Send sends elements to channel in normal act it sends all elements but if func canceled it can be less
it locks execution of gorutine it doesn't close channel after work returns sent elements if len(this) != len(old) considered func was canceled
func Sequence ¶
func Sequence[T constraints.Integer | constraints.Float](ss []T, params ...int) []T
Sequence generates all numbers in range or returns nil if params invalid
There are 3 variations to generate:
- [0, n).
- [min, max).
- [min, max) with step.
if len(params) == 1 considered that will be returned slice between 0 and n, where n is the first param, [0, n). if len(params) == 2 considered that will be returned slice between min and max, where min is the first param, max is the second, [min, max). if len(params) > 2 considered that will be returned slice between min and max with step, where min is the first param, max is the second, step is the third one, [min, max) with step, others params will be ignored
func SequenceUsing ¶
SequenceUsing generates slice in range using creator function
There are 3 variations to generate:
- [0, n).
- [min, max).
- [min, max) with step.
if len(params) == 1 considered that will be returned slice between 0 and n, where n is the first param, [0, n). if len(params) == 2 considered that will be returned slice between min and max, where min is the first param, max is the second, [min, max). if len(params) > 2 considered that will be returned slice between min and max with step, where min is the first param, max is the second, step is the third one, [min, max) with step, others params will be ignored
func Shift ¶
func Shift[T any](ss []T) (T, []T)
Shift will return two values: the shifted value and the rest slice. if the slice is empty then returned shifted value is the zero value of the slice elements and the rest slice is empty slice
func Shuffle ¶
Shuffle returns a new shuffled slice by your rand.Source. The original slice is not modified.
func Sort ¶
func Sort[T constraints.Ordered](ss []T) []T
Sort works similar to sort.SliceType(). However, unlike sort.SliceType the slice returned will be reallocated as to not modify the input slice.
See Reverse() and AreSorted().
func SortStableUsing ¶
func SortStableUsing[T comparable](ss []T, less func(a, b T) bool) []T
SortStableUsing works similar to sort.SliceStable. However, unlike sort.SliceStable the slice returned will be reallocated as to not modify the input slice.
func SortUsing ¶
SortUsing works similar to sort.Slice. However, unlike sort.Slice the slice returned will be reallocated as to not modify the input slice.
func Stddev ¶
func Stddev[T constraints.Integer | constraints.Float](ss []T) float64
Stddev is the standard deviation
func String ¶
func String[T constraints.Ordered](s T) string
String transforms a value into a string. Nil values will be treated as empty strings.
If the element type implements fmt.Stringer it will be used. Otherwise it will fallback to the result of:
fmt.Sprintf("%v")
func Strings ¶
func Strings[T constraints.Ordered](ss []T) []string
Strings transforms each element to a string.
If the element type implements fmt.Stringer it will be used. Otherwise it will fallback to the result of:
fmt.Sprintf("%v")
func StringsUsing ¶
StringsUsing transforms each element to a string.
func SubSlice ¶
SubSlice will return the subSlice from start to end(excluded)
Condition 1: If start < 0 or end < 0, nil is returned. Condition 2: If start >= end, nil is returned. Condition 3: Return all elements that exist in the range provided, if start or end is out of bounds, zero items will be placed.
func Sum ¶
func Sum[T constraints.Integer | constraints.Float](ss []T) (sum T)
Sum is the sum of all of the elements.
func Top ¶
Top will return n elements from head of the slice if the slice has less elements then n that'll return all elements if n < 0 it'll return empty slice.
func Unique ¶
func Unique[T comparable](ss []T) []T
Unique returns a new slice with all of the unique values.
The items will be returned in a randomized order, even with the same input.
The number of items returned may be the same as the input or less. It will never return zero items unless then input slice has zero items.
A slice with zero elements is considered to be unique.
See AreUnique().
func UniqueStable ¶ added in v2.9.0
func UniqueStable[T comparable](ss []T) []T
UniqueStable works similar to Unique. However, unlike Unique the slice returned will be in previous relative order
func Unshift ¶
func Unshift[T any](ss []T, elements ...T) (unshift []T)
Unshift adds one or more elements to the beginning of the slice and returns the new slice.
func Values ¶
func Values[K comparable, V any](m map[K]V) []V
Values returns the values in the map.
Due to Go's randomization of iterating maps the order is not deterministic.
Types ¶
type OfNumericSlice ¶
type OfNumericSlice[T constraints.Integer | constraints.Float] struct { Result []T }
OfNumericSlice provides the proxy methods that operate on slices. If the last method in the chain does not return a single value, you can access the Result to get final slice.
func OfNumeric ¶
func OfNumeric[T constraints.Integer | constraints.Float](ss []T) OfNumericSlice[T]
OfNumeric encapsulates a slice to be used in multiple chained operations. OfNumeric requires that elements be numerical for certain operations to be performed.
func (OfNumericSlice[T]) All ¶
func (o OfNumericSlice[T]) All(fn func(value T) bool) bool
func (OfNumericSlice[T]) Any ¶
func (o OfNumericSlice[T]) Any(fn func(value T) bool) bool
func (OfNumericSlice[T]) AreSorted ¶
func (o OfNumericSlice[T]) AreSorted() bool
func (OfNumericSlice[T]) AreUnique ¶
func (o OfNumericSlice[T]) AreUnique() bool
func (OfNumericSlice[T]) Average ¶
func (o OfNumericSlice[T]) Average() float64
func (OfNumericSlice[T]) Bottom ¶
func (o OfNumericSlice[T]) Bottom(n int) OfNumericSlice[T]
func (OfNumericSlice[T]) Contains ¶
func (o OfNumericSlice[T]) Contains(lookingFor T) bool
func (OfNumericSlice[T]) Delete ¶ added in v2.7.0
func (o OfNumericSlice[T]) Delete(idx ...int) OfNumericSlice[T]
func (OfNumericSlice[T]) Diff ¶
func (o OfNumericSlice[T]) Diff(against []T) ([]T, []T)
func (OfNumericSlice[T]) DropTop ¶
func (o OfNumericSlice[T]) DropTop(n int) OfNumericSlice[T]
func (OfNumericSlice[T]) DropWhile ¶
func (o OfNumericSlice[T]) DropWhile(f func(s T) bool) OfNumericSlice[T]
func (OfNumericSlice[T]) Each ¶
func (o OfNumericSlice[T]) Each(fn func(T)) OfNumericSlice[T]
func (OfNumericSlice[T]) Equals ¶
func (o OfNumericSlice[T]) Equals(rhs []T) bool
func (OfNumericSlice[T]) Filter ¶
func (o OfNumericSlice[T]) Filter(condition func(T) bool) OfNumericSlice[T]
func (OfNumericSlice[T]) FilterNot ¶
func (o OfNumericSlice[T]) FilterNot(condition func(T) bool) OfNumericSlice[T]
func (OfNumericSlice[T]) FindFirstUsing ¶
func (o OfNumericSlice[T]) FindFirstUsing(fn func(value T) bool) int
func (OfNumericSlice[T]) First ¶ added in v2.2.0
func (o OfNumericSlice[T]) First() T
func (OfNumericSlice[T]) FirstOr ¶
func (o OfNumericSlice[T]) FirstOr(defaultValue T) T
func (OfNumericSlice[T]) Float64s ¶
func (o OfNumericSlice[T]) Float64s() []float64
func (OfNumericSlice[T]) Group ¶
func (o OfNumericSlice[T]) Group() map[T]int
func (OfNumericSlice[T]) Insert ¶
func (o OfNumericSlice[T]) Insert(index int, values ...T) OfNumericSlice[T]
func (OfNumericSlice[T]) Intersect ¶
func (o OfNumericSlice[T]) Intersect(slices ...[]T) OfNumericSlice[T]
func (OfNumericSlice[T]) Ints ¶
func (o OfNumericSlice[T]) Ints() []int
func (OfNumericSlice[T]) JSONBytes ¶
func (o OfNumericSlice[T]) JSONBytes() []byte
func (OfNumericSlice[T]) JSONBytesIndent ¶
func (o OfNumericSlice[T]) JSONBytesIndent(prefix, indent string) []byte
func (OfNumericSlice[T]) JSONString ¶
func (o OfNumericSlice[T]) JSONString() string
func (OfNumericSlice[T]) JSONStringIndent ¶
func (o OfNumericSlice[T]) JSONStringIndent(prefix, indent string) string
func (OfNumericSlice[T]) Join ¶
func (o OfNumericSlice[T]) Join(glue string) string
func (OfNumericSlice[T]) Last ¶ added in v2.2.0
func (o OfNumericSlice[T]) Last() T
func (OfNumericSlice[T]) LastOr ¶
func (o OfNumericSlice[T]) LastOr(defaultValue T) T
func (OfNumericSlice[T]) Map ¶
func (o OfNumericSlice[T]) Map(fn func(T) T) OfNumericSlice[T]
func (OfNumericSlice[T]) Max ¶
func (o OfNumericSlice[T]) Max() T
func (OfNumericSlice[T]) Median ¶
func (o OfNumericSlice[T]) Median() T
func (OfNumericSlice[T]) Min ¶
func (o OfNumericSlice[T]) Min() T
func (OfNumericSlice[T]) Mode ¶
func (o OfNumericSlice[T]) Mode() OfNumericSlice[T]
func (OfNumericSlice[T]) Product ¶
func (o OfNumericSlice[T]) Product() T
func (OfNumericSlice[T]) Random ¶
func (o OfNumericSlice[T]) Random(source rand.Source) T
func (OfNumericSlice[T]) Reduce ¶
func (o OfNumericSlice[T]) Reduce(reducer func(T, T) T) T
func (OfNumericSlice[T]) Reverse ¶
func (o OfNumericSlice[T]) Reverse() OfNumericSlice[T]
func (OfNumericSlice[T]) Send ¶
func (o OfNumericSlice[T]) Send(ctx context.Context, ch chan<- T) OfNumericSlice[T]
func (OfNumericSlice[T]) Sequence ¶
func (o OfNumericSlice[T]) Sequence(params ...int) OfNumericSlice[T]
func (OfNumericSlice[T]) SequenceUsing ¶
func (o OfNumericSlice[T]) SequenceUsing(creator func(int) T, params ...int) OfNumericSlice[T]
func (OfNumericSlice[T]) Shuffle ¶
func (o OfNumericSlice[T]) Shuffle(source rand.Source) OfNumericSlice[T]
func (OfNumericSlice[T]) Sort ¶
func (o OfNumericSlice[T]) Sort() OfNumericSlice[T]
func (OfNumericSlice[T]) SortStableUsing ¶
func (o OfNumericSlice[T]) SortStableUsing(less func(a, b T) bool) OfNumericSlice[T]
func (OfNumericSlice[T]) SortUsing ¶
func (o OfNumericSlice[T]) SortUsing(less func(a, b T) bool) OfNumericSlice[T]
func (OfNumericSlice[T]) Stddev ¶
func (o OfNumericSlice[T]) Stddev() float64
func (OfNumericSlice[T]) Strings ¶
func (o OfNumericSlice[T]) Strings() []string
func (OfNumericSlice[T]) StringsUsing ¶
func (o OfNumericSlice[T]) StringsUsing(transform func(T) string) []string
func (OfNumericSlice[T]) SubSlice ¶
func (o OfNumericSlice[T]) SubSlice(start int, end int) OfNumericSlice[T]
func (OfNumericSlice[T]) Sum ¶
func (o OfNumericSlice[T]) Sum() T
func (OfNumericSlice[T]) Top ¶
func (o OfNumericSlice[T]) Top(n int) OfNumericSlice[T]
func (OfNumericSlice[T]) Unique ¶
func (o OfNumericSlice[T]) Unique() OfNumericSlice[T]
func (OfNumericSlice[T]) UniqueStable ¶ added in v2.9.0
func (o OfNumericSlice[T]) UniqueStable() OfNumericSlice[T]
func (OfNumericSlice[T]) Unshift ¶
func (o OfNumericSlice[T]) Unshift(elements ...T) OfNumericSlice[T]
type OfOrderedSlice ¶
type OfOrderedSlice[T constraints.Ordered] struct { Result []T }
OfOrderedSlice provides the proxy methods that operate on slices. If the last method in the chain does not return a single value, you can access the Result to get final slice.
func OfOrdered ¶
func OfOrdered[T constraints.Ordered](ss []T) OfOrderedSlice[T]
OfOrdered encapsulates a slice to be used in multiple chained operations. OfOrdered requires that elements be numerical or a string for certain operations to be performed.
func (OfOrderedSlice[T]) All ¶
func (o OfOrderedSlice[T]) All(fn func(value T) bool) bool
func (OfOrderedSlice[T]) Any ¶
func (o OfOrderedSlice[T]) Any(fn func(value T) bool) bool
func (OfOrderedSlice[T]) AreSorted ¶
func (o OfOrderedSlice[T]) AreSorted() bool
func (OfOrderedSlice[T]) AreUnique ¶
func (o OfOrderedSlice[T]) AreUnique() bool
func (OfOrderedSlice[T]) Bottom ¶
func (o OfOrderedSlice[T]) Bottom(n int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Contains ¶
func (o OfOrderedSlice[T]) Contains(lookingFor T) bool
func (OfOrderedSlice[T]) Delete ¶ added in v2.7.0
func (o OfOrderedSlice[T]) Delete(idx ...int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Diff ¶
func (o OfOrderedSlice[T]) Diff(against []T) ([]T, []T)
func (OfOrderedSlice[T]) DropTop ¶
func (o OfOrderedSlice[T]) DropTop(n int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) DropWhile ¶
func (o OfOrderedSlice[T]) DropWhile(f func(s T) bool) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Each ¶
func (o OfOrderedSlice[T]) Each(fn func(T)) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Equals ¶
func (o OfOrderedSlice[T]) Equals(rhs []T) bool
func (OfOrderedSlice[T]) Filter ¶
func (o OfOrderedSlice[T]) Filter(condition func(T) bool) OfOrderedSlice[T]
func (OfOrderedSlice[T]) FilterNot ¶
func (o OfOrderedSlice[T]) FilterNot(condition func(T) bool) OfOrderedSlice[T]
func (OfOrderedSlice[T]) FindFirstUsing ¶
func (o OfOrderedSlice[T]) FindFirstUsing(fn func(value T) bool) int
func (OfOrderedSlice[T]) First ¶ added in v2.2.0
func (o OfOrderedSlice[T]) First() T
func (OfOrderedSlice[T]) FirstOr ¶
func (o OfOrderedSlice[T]) FirstOr(defaultValue T) T
func (OfOrderedSlice[T]) Float64s ¶
func (o OfOrderedSlice[T]) Float64s() []float64
func (OfOrderedSlice[T]) Group ¶
func (o OfOrderedSlice[T]) Group() map[T]int
func (OfOrderedSlice[T]) Insert ¶
func (o OfOrderedSlice[T]) Insert(index int, values ...T) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Intersect ¶
func (o OfOrderedSlice[T]) Intersect(slices ...[]T) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Ints ¶
func (o OfOrderedSlice[T]) Ints() []int
func (OfOrderedSlice[T]) JSONBytes ¶
func (o OfOrderedSlice[T]) JSONBytes() []byte
func (OfOrderedSlice[T]) JSONBytesIndent ¶
func (o OfOrderedSlice[T]) JSONBytesIndent(prefix, indent string) []byte
func (OfOrderedSlice[T]) JSONString ¶
func (o OfOrderedSlice[T]) JSONString() string
func (OfOrderedSlice[T]) JSONStringIndent ¶
func (o OfOrderedSlice[T]) JSONStringIndent(prefix, indent string) string
func (OfOrderedSlice[T]) Join ¶
func (o OfOrderedSlice[T]) Join(glue string) string
func (OfOrderedSlice[T]) Last ¶ added in v2.2.0
func (o OfOrderedSlice[T]) Last() T
func (OfOrderedSlice[T]) LastOr ¶
func (o OfOrderedSlice[T]) LastOr(defaultValue T) T
func (OfOrderedSlice[T]) Map ¶
func (o OfOrderedSlice[T]) Map(fn func(T) T) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Max ¶
func (o OfOrderedSlice[T]) Max() T
func (OfOrderedSlice[T]) Min ¶
func (o OfOrderedSlice[T]) Min() T
func (OfOrderedSlice[T]) Mode ¶
func (o OfOrderedSlice[T]) Mode() OfOrderedSlice[T]
func (OfOrderedSlice[T]) Reverse ¶
func (o OfOrderedSlice[T]) Reverse() OfOrderedSlice[T]
func (OfOrderedSlice[T]) Send ¶
func (o OfOrderedSlice[T]) Send(ctx context.Context, ch chan<- T) OfOrderedSlice[T]
func (OfOrderedSlice[T]) SequenceUsing ¶
func (o OfOrderedSlice[T]) SequenceUsing(creator func(int) T, params ...int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Shuffle ¶
func (o OfOrderedSlice[T]) Shuffle(source rand.Source) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Sort ¶
func (o OfOrderedSlice[T]) Sort() OfOrderedSlice[T]
func (OfOrderedSlice[T]) SortStableUsing ¶
func (o OfOrderedSlice[T]) SortStableUsing(less func(a, b T) bool) OfOrderedSlice[T]
func (OfOrderedSlice[T]) SortUsing ¶
func (o OfOrderedSlice[T]) SortUsing(less func(a, b T) bool) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Strings ¶
func (o OfOrderedSlice[T]) Strings() []string
func (OfOrderedSlice[T]) StringsUsing ¶
func (o OfOrderedSlice[T]) StringsUsing(transform func(T) string) []string
func (OfOrderedSlice[T]) SubSlice ¶
func (o OfOrderedSlice[T]) SubSlice(start int, end int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Top ¶
func (o OfOrderedSlice[T]) Top(n int) OfOrderedSlice[T]
func (OfOrderedSlice[T]) Unique ¶
func (o OfOrderedSlice[T]) Unique() OfOrderedSlice[T]
func (OfOrderedSlice[T]) UniqueStable ¶ added in v2.9.0
func (o OfOrderedSlice[T]) UniqueStable() OfOrderedSlice[T]
func (OfOrderedSlice[T]) Unshift ¶
func (o OfOrderedSlice[T]) Unshift(elements ...T) OfOrderedSlice[T]
type OfSlice ¶
type OfSlice[T any] struct { Result []T }
OfSlice provides the proxy methods that operate on slices. If the last method in the chain does not return a single value, you can access the Result to get final slice.
func (OfSlice[T]) All ¶
All will return true if all callbacks return true. It follows the same logic as the all() function in Python.
If the list is empty then true is always returned.
func (OfSlice[T]) Any ¶
Any will return true if any callbacks return true. It follows the same logic as the any() function in Python.
If the list is empty then false is always returned.
func (OfSlice[T]) Bottom ¶
Bottom will return n elements from bottom
that means that elements is taken from the end of the slice for this [1,2,3] slice with n == 2 will be returned [3,2] if the slice has less elements then n that'll return all elements if n < 0 it'll return empty slice.
func (OfSlice[T]) Delete ¶ added in v2.7.0
Removes element at index in idx from input slice, returns resulting slice. If an index in idx out of bounds, skip it.
func (OfSlice[T]) DropTop ¶
DropTop will return the rest slice after dropping the top n elements if the slice has less elements then n that'll return empty slice if n < 0 it'll return empty slice.
func (OfSlice[T]) Each ¶
Each is more condensed version of Transform that allows an action to happen on each elements and pass the original slice on.
pie.Each(cars, func (car *Car) { fmt.Printf("Car color is: %s\n", car.Color) })
Pie will not ensure immutability on items passed in so they can be manipulated, if you choose to do it this way, for example:
// Set all car colors to Red. pie.Each(cars, func (car *Car) { car.Color = "Red" })
func (OfSlice[T]) Filter ¶
Filter will return a new slice containing only the elements that return true from the condition. The returned slice may contain zero elements (nil).
FilterNot works in the opposite way of Filter.
func (OfSlice[T]) FilterNot ¶
FilterNot works the same as Filter, with a negated condition. That is, it will return a new slice only containing the elements that returned false from the condition. The returned slice may contain zero elements (nil).
func (OfSlice[T]) FindFirstUsing ¶
FindFirstUsing will return the index of the first element when the callback returns true or -1 if no element is found. It follows the same logic as the findIndex() function in Javascript.
If the list is empty then -1 is always returned.
func (OfSlice[T]) First ¶ added in v2.2.0
func (o OfSlice[T]) First() T
First returns the first element or a zero value if there are no elements.
func (OfSlice[T]) FirstOr ¶
func (o OfSlice[T]) FirstOr(defaultValue T) T
FirstOr returns the first element or a default value if there are no elements.
func (OfSlice[T]) Last ¶ added in v2.2.0
func (o OfSlice[T]) Last() T
Last returns the last element or a zero value if there are no elements.
func (OfSlice[T]) LastOr ¶
func (o OfSlice[T]) LastOr(defaultValue T) T
LastOr returns the last element or a default value if there are no elements.
func (OfSlice[T]) Map ¶
Map will return a new slice where each element has been mapped (transformed). The number of elements returned will always be the same as the input.
Be careful when using this with slices of pointers. If you modify the input value it will affect the original slice. Be sure to return a new allocated object or deep copy the existing one.
func (OfSlice[T]) Reverse ¶
Reverse returns a new copy of the slice with the elements ordered in reverse. This is useful when combined with Sort to get a descending sort order:
ss.Sort().Reverse()
func (OfSlice[T]) Rotate ¶ added in v2.8.0
Rotate returns slice circularly rotated by a number of positions n. If n is positive, the slice is rotated right. If n is negative, the slice is rotated left.
func (OfSlice[T]) Send ¶
Send sends elements to channel in normal act it sends all elements but if func canceled it can be less
it locks execution of gorutine it doesn't close channel after work returns sent elements if len(this) != len(old) considered func was canceled
func (OfSlice[T]) SequenceUsing ¶
SequenceUsing generates slice in range using creator function
There are 3 variations to generate:
- [0, n).
- [min, max).
- [min, max) with step.
if len(params) == 1 considered that will be returned slice between 0 and n, where n is the first param, [0, n). if len(params) == 2 considered that will be returned slice between min and max, where min is the first param, max is the second, [min, max). if len(params) > 2 considered that will be returned slice between min and max with step, where min is the first param, max is the second, step is the third one, [min, max) with step, others params will be ignored
func (OfSlice[T]) Shuffle ¶
Shuffle returns a new shuffled slice by your rand.Source. The original slice is not modified.
func (OfSlice[T]) SortUsing ¶
SortUsing works similar to sort.Slice. However, unlike sort.Slice the slice returned will be reallocated as to not modify the input slice.
func (OfSlice[T]) StringsUsing ¶
StringsUsing transforms each element to a string.
func (OfSlice[T]) SubSlice ¶
SubSlice will return the subSlice from start to end(excluded)
Condition 1: If start < 0 or end < 0, nil is returned. Condition 2: If start >= end, nil is returned. Condition 3: Return all elements that exist in the range provided, if start or end is out of bounds, zero items will be placed.
type Zipped ¶ added in v2.6.0
type Zipped[T1, T2 any] struct { A T1 B T2 }
A pair struct containing two zipped values.
func Zip ¶ added in v2.6.0
Zip will return a new slice containing pairs with elements from input slices. If input slices have diffrent length, the output slice will be truncated to the length of the smallest input slice.
func ZipLongest ¶ added in v2.6.0
ZipLongest will return a new slice containing pairs with elements from input slices. If input slices have different length, missing elements will be padded with default values.
Source Files ¶
- abs.go
- all.go
- any.go
- are_sorted.go
- are_unique.go
- average.go
- bottom.go
- chunk.go
- contains.go
- delete.go
- diff.go
- drop_top.go
- drop_while.go
- each.go
- equals.go
- filter.go
- filter_not.go
- find_first_using.go
- first.go
- first_or.go
- flat.go
- float64.go
- float64s.go
- group.go
- groupby.go
- insert.go
- int.go
- intersect.go
- ints.go
- join.go
- json_bytes.go
- json_bytes_indent.go
- json_string.go
- json_string_indent.go
- keys.go
- last.go
- last_or.go
- map.go
- max.go
- median.go
- min.go
- mode.go
- of.go
- of_numeric.go
- of_ordered.go
- pop.go
- product.go
- random.go
- reduce.go
- reverse.go
- rotate.go
- send.go
- sequence.go
- sequence_using.go
- shift.go
- shuffle.go
- sort.go
- sort_stable_using.go
- sort_using.go
- stddev.go
- string.go
- strings.go
- strings_using.go
- sub_slice.go
- sum.go
- top.go
- unique.go
- unique_stable.go
- unshift.go
- values.go
- zip.go
- zip_longest.go