Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Last ¶
func Last[T any](collection []T) (init []T, last T)
Last removes the Last element from collection and returns the resulting slice and the final element. The last of a single item is an empty slice and itself.
func Pop ¶
func Pop[T any](collection []T) (head T, tail []T)
Pop removes and returns the first element of collection and the resulting slice. The head of a single item is itself and an empty slice.
func SliceEqual ¶
func SliceEqual[V constraints.Ordered](first, second []V) bool
SliceEqual will attempt to test each slice element for equality in order.
func TakeN ¶
TakeN will remove count elements from the end of from and return slices of both the remaining elements and the taken elements. The taken elements retain the order of the original slice. Will return empty slices if the from slice is empty. Attempting to take a negative number of elements will result in returning the given slice unaltered and an empty taken slice. Taking more elements than that which exists in the given collection will result in an empty remaining slice and the given collection.
Types ¶
This section is empty.