HUGO
Menu
GitHub 87548 stars Mastodon

Hugo collections.After

collections.After N SLICE

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

Hugo collections.Append

collections.Append ELEMENT [ELEMENT...] SLICE

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

Hugo collections.Apply

collections.Apply SLICE FUNCTION PARAM...

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

Hugo collections.Complement

collections.Complement SLICE [SLICE...]

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

Hugo collections.D

collections.D SEED N HIGH

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

Hugo collections.Delimit

collections.Delimit SLICE|MAP DELIMITER [LAST]

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

Hugo collections.Dictionary

collections.Dictionary [VALUE...]

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

Hugo collections.First

collections.First N SLICE|STRING

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

Hugo collections.Group

collections.Group KEY PAGES

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

Hugo collections.In

collections.In SLICE|STRING VALUE

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

Hugo collections.Index

collections.Index SLICE|MAP KEY...

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

Hugo collections.Intersect

collections.Intersect SLICE1 SLICE2

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

Hugo collections.IsSet

collections.IsSet MAP|SLICE KEY|INDEX

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

Hugo collections.KeyVals

collections.KeyVals KEY VALUE...

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

Hugo collections.Last

collections.Last N SLICE|STRING

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

Hugo collections.Merge

collections.Merge MAP MAP...

Hugo Returns a map by combining two or more given maps.

Hugo collections.NewScratch

collections.NewScratch

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

Hugo collections.Querify

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

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

Hugo collections.Reverse

collections.Reverse SLICE

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

Hugo collections.Seq

collections.Seq LAST

Hugo 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.

Hugo collections.Shuffle

collections.Shuffle SLICE

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

Hugo collections.Slice

collections.Slice [VALUE...]

Hugo Returns a slice created from the given values.

Hugo collections.Sort

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

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

Hugo collections.SymDiff

SLICE1 | collections.SymDiff SLICE2

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

Hugo collections.Union

collections.Union SLICE1 SLICE2

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

Hugo collections.Uniq

collections.Uniq SLICE

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

Hugo collections.Where

collections.Where SLICE KEY [OPERATOR] VALUE

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