HUGO
Menu
GitHub 86601 stars Mastodon

collections.After

collections.After N SLICE

Returns a slice containing the elements after the first N elements of the given slice.

collections.Append

collections.Append ELEMENT [ELEMENT...] SLICE

Returns a slice by adding one or more elements, or an entire second slice, to the end of the given slice.

collections.Apply

collections.Apply SLICE FUNCTION PARAM...

Returns a slice by transforming each element of the given slice using a specific function and parameters.

collections.Complement

collections.Complement SLICE [SLICE...]

Returns a slice by identifying elements in the last given slice that do not appear in any of the preceding slices.

collections.D

collections.D SEED N HIGH

Returns a sorted slice of unique random integers based on a given seed, count, and maximum value.

collections.Delimit

collections.Delimit SLICE|MAP DELIMITER [LAST]

Returns a string by joining the values of the given slice or map with a delimiter.

collections.Dictionary

collections.Dictionary [VALUE...]

Returns a map created from the given key-value pairs.

collections.First

collections.First N SLICE|STRING

Returns the first N elements of the given slice or string.

collections.Group

collections.Group KEY PAGES

Returns a map by grouping the given page collection (slice) by a specific key.

collections.In

collections.In SLICE|STRING VALUE

Reports whether a value exists within the given slice or string.

collections.Index

collections.Index SLICE|MAP KEY...

Returns an element or value from the given slice or map at the specified key(s).

collections.Intersect

collections.Intersect SLICE1 SLICE2

Returns a slice containing the common elements found in two given slices, in the same order as the first slice.

collections.IsSet

collections.IsSet MAP|SLICE KEY|INDEX

Reports whether a specific key or index exists in the given map or slice.

collections.KeyVals

collections.KeyVals KEY VALUE...

Returns a KeyVals struct by pairing a given key and values.

collections.Last

collections.Last N SLICE|STRING

Returns the last N elements of the given slice or string.

collections.Merge

collections.Merge MAP MAP...

Returns a map by combining two or more given maps.

collections.NewScratch

collections.NewScratch

Returns a locally scoped "scratch pad" to store and manipulate data.

collections.Querify

collections.Querify MAP|SLICE|KEY VALUE...

Returns a URL query string from the given map, slice, or sequence of key-value pairs.

collections.Reverse

collections.Reverse SLICE

Returns a slice by reversing the order of elements in the given slice.

collections.Seq

collections.Seq LAST

Returns a slice of integers starting from 1 or a given value, incrementing by 1 or a given value, and ending at a given value.

collections.Shuffle

collections.Shuffle SLICE

Returns a slice by randomizing the element order of the given slice.

collections.Slice

collections.Slice [VALUE...]

Returns a slice created from the given values.

collections.Sort

collections.Sort MAP|SLICE [KEY] [ORDER]

Returns a sorted map or slice by reordering the given collection by a key and order.

collections.SymDiff

SLICE1 | collections.SymDiff SLICE2

Returns a slice containing the symmetric difference of two given slices.

collections.Union

collections.Union SLICE1 SLICE2

Returns a slice containing the unique elements from two given slices.

collections.Uniq

collections.Uniq SLICE

Returns a slice by removing duplicate elements from the given slice.

collections.Where

collections.Where SLICE KEY [OPERATOR] VALUE

Returns a slice by filtering the given slice based on a key, operator, and value.