tpl: Add uniq function

This commit is contained in:
Nathan Sharfi 2017-05-29 12:03:38 -07:00 committed by Bjørn Erik Pedersen
parent c2a52c1cf8
commit 041b6c9145

View File

@ -373,6 +373,15 @@ e.g.
{{ .Content }} {{ .Content }}
{{ end }} {{ end }}
### uniq
Takes in a slice or array and returns a slice with subsequent duplicate elements removed.
{{ uniq (slice 1 2 3 2) }}
{{ slice 1 2 3 2 | uniq }}
<!-- both return [1 2 3] -->
## Files ## Files
### readDir ### readDir