Categorygithub.com/lianglei-git/go-es6
modulepackage
0.0.0-20240107083334-17e188347918
Repository: https://github.com/lianglei-git/go-es6.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

Assign merges multiple maps from left to right.
Associate returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
Chunk returns an array of elements split into groups the length of size.
ChunkString returns an array of strings split into groups the length of size.
Coalesce returns the first non-empty arguments.
Compact returns a slice of all non-zero elements.
Contains returns true if an element is present in a collection.
ContainsBy returns true if predicate function return true.
Count counts the number of elements in the collection that compare equal to value.
CountBy counts the number of elements in the collection for which predicate is true.
CountValues counts the number of each element in the collection.
CountValuesBy counts the number of each element return from mapper function.
Difference returns the difference between two collections.
Drop drops n elements from the beginning of a slice or array.
DropRight drops n elements from the end of a slice or array.
DropRightWhile drops elements from the end of a slice or array while the predicate returns true.
DropWhile drops elements from the beginning of a slice or array while the predicate returns true.
Empty returns an empty value.
EmptyableToPtr returns a pointer copy of value if it's nonzero.
Entries transforms a map into array of key/value pairs.
Every returns true if all elements of a subset are contained into a collection or if the subset is empty.
EveryBy returns true if the predicate returns true for all of the elements in the collection or if the collection is empty.
Fill fills elements of array with `initial` value.
Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for.
FilterMap returns a slice which obtained after both filtering and mapping using the given callback function.
Find search an element in a slice based on a predicate.
FindDuplicates returns a slice with the first occurrence of each duplicated elements of the collection.
FindDuplicatesBy returns a slice with the first occurrence of each duplicated elements of the collection.
FindIndexOf searches an element in a slice based on a predicate and returns the index and true.
FindKey returns the key of the first value matching.
FindKeyBy returns the key of the first element predicate returns truthy for.
FindLastIndexOf searches last element in a slice based on a predicate and returns the index and true.
FindOrElse search an element in a slice based on a predicate.
FindUniques returns a slice with all the unique elements of the collection.
FindUniquesBy returns a slice with all the unique elements of the collection.
FlatMap manipulates a slice and transforms and flattens it to a slice of another type.
Flatten returns an array a single level deep.
ForEach iterates over elements of collection and invokes iteratee for each element.
FromAnySlice returns an `any` slice with all elements mapped to a type.
FromEntries transforms an array of key/value pairs into a map.
FromPairs transforms an array of key/value pairs into a map.
FromPtr returns the pointer value or empty.
FromPtrOr returns the pointer value or the fallback value.
No description provided by the author
No description provided by the author
GroupBy returns an object composed of keys generated from the results of running each element of collection through iteratee.
No description provided by the author
IndexOf returns the index at which the first occurrence of a value is found in an array or return -1 if the value cannot be found.
Interleave round-robin alternating input slices and sequentially appending value at index into result Play: https://go.dev/play/p/DDhlwrShbwe.
Intersect returns the intersection between two collections.
Invert creates a map composed of the inverted keys and values.
IsEmpty returns true if argument is a zero value.
IsNotEmpty returns true if argument is not a zero value.
IsSorted checks if a slice is sorted.
IsSortedByKey checks if a slice is sorted by iteratee.
KeyBy transforms a slice or an array of structs to a map based on a pivot callback.
Keys creates an array of the map keys.
Last returns the last element of a collection or error if empty.
LastIndexOf returns the index at which the last occurrence of a value is found in an array or return -1 if the value cannot be found.
Map manipulates a slice and transforms it to a slice of another type.
MapEntries manipulates a map entries and transforms it to a map of another type.
MapKeys manipulates a map keys and transforms it to a map of another type.
MapToSlice transforms a map into a slice based on specific iteratee Play: https://go.dev/play/p/ZuiCZpDt6LD.
MapValues manipulates a map values and transforms it to a map of another type.
Max searches the maximum value of a collection.
MaxBy search the maximum value of a collection using the given comparison function.
Min search the minimum value of a collection.
MinBy search the minimum value of a collection using the given comparison function.
No description provided by the author
None returns true if no element of a subset are contained into a collection or if the subset is empty.
NoneBy returns true if the predicate returns true for none of the elements in the collection or if the collection is empty.
Nth returns the element at index `nth` of collection.
OmitBy returns same map type filtered by given predicate.
OmitByKeys returns same map type filtered by given keys.
OmitByValues returns same map type filtered by given values.
PartitionBy returns an array of elements split into groups.
PickBy returns same map type filtered by given predicate.
PickByKeys returns same map type filtered by given keys.
PickByValues returns same map type filtered by given values.
RandomString return a random string.
Reduce reduces collection to a value which is the accumulated result of running each element in collection through accumulator, where each successive invocation is supplied the return value of the previous.
ReduceRight helper is like Reduce except that it iterates over elements of collection from right to left.
Reject is the opposite of Filter, this method returns the elements of collection that predicate does not return truthy for.
Repeat builds a slice with N copies of initial value.
RepeatBy builds a slice with values returned by N calls of callback.
Replace returns a copy of the slice with the first n non-overlapping instances of old replaced by new.
ReplaceAll returns a copy of the slice with all non-overlapping instances of old replaced by new.
Reverse reverses array so that the first element becomes the last, the second element becomes the second to last, and so on.
RuneLength is an alias to utf8.RuneCountInString which returns the number of runes in string.
Sample returns a random item from collection.
Samples returns N random unique items from collection.
Shuffle returns an array of shuffled values.
Slice returns a copy of a slice from `start` up to, but not including `end`.
SliceToMap returns a map containing key-value pairs provided by transform function applied to elements of the given slice.
Some returns true if at least 1 element of a subset is contained into a collection.
SomeBy returns true if the predicate returns true for any of the elements in the collection.
Subset returns a copy of a slice from `offset` up to `length` elements.
Substring return part of a string.
Times invokes the iteratee n times, returning an array of the results of each invocation.
ToAnySlice returns a slice with all elements mapped to `any` type.
ToPairs transforms a map into array of key/value pairs.
ToPtr returns a pointer copy of value.
ToSlicePtr returns a slice of pointer copy of value.
Union returns all distinct elements from given collections.
Uniq returns a duplicate-free version of an array, in which only the first occurrence of each element is kept.
UniqBy returns a duplicate-free version of an array, in which only the first occurrence of each element is kept.
ValueOr returns the value of the given key or the fallback value if the key is not present.
Values creates an array of the map values.
Without returns slice excluding all given values.
WithoutEmpty returns slice excluding empty values.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Entry
Entry defines a key/value pairs.
No description provided by the author
Tuple2 is a group of 2 elements (pair).
Tuple3 is a group of 3 elements.
Tuple4 is a group of 4 elements.
Tuple5 is a group of 5 elements.
Tuple6 is a group of 6 elements.
Tuple7 is a group of 7 elements.
Tuple8 is a group of 8 elements.
Tuple9 is a group of 9 elements.

# Interfaces

Clonable defines a constraint of types having Clone() T method.
Complex is a constraint that permits any complex numeric type.
Float is a constraint that permits any floating-point type.
Integer is a constraint that permits any integer type.
Ordered is a constraint that permits any ordered type: any type that supports the operators < <= >= >.
Signed is a constraint that permits any signed integer type.
Unsigned is a constraint that permits any unsigned integer type.