mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-03 12:12:37 +00:00
collections.Seq: Specify max slice size
This commit is contained in:
@@ -21,7 +21,7 @@ aliases: [/functions/seq]
|
||||
{{ seq -2 2 2 }} → [-2 0 2]
|
||||
```
|
||||
|
||||
Iterate over a sequence of integers:
|
||||
A contrived example of iterating over a sequence of integers:
|
||||
|
||||
```go-html-template
|
||||
{{ $product := 1 }}
|
||||
@@ -31,10 +31,6 @@ Iterate over a sequence of integers:
|
||||
{{ $product }} → 24
|
||||
```
|
||||
|
||||
The example above is contrived. To calculate the product of 2 or more numbers, use the [`math.Product`] function:
|
||||
|
||||
```go-html-template
|
||||
{{ math.Product (seq 4) }} → 24
|
||||
```
|
||||
|
||||
[`math.Product`]: /functions/math/product
|
||||
{{% note %}}
|
||||
The slice created by the `seq` function is limited to 2000 elements.
|
||||
{{% /note %}}
|
||||
|
||||
Reference in New Issue
Block a user