tpl: Add uniq function

This commit is contained in:
Nathan Sharfi authored and Bjørn Erik Pedersen committed 2017-06-03 19:13:58 +02:00
1 parent c2a52c1cf8
commit 041b6c9145
1 file changed
+9
+9
View File
@@ -373,6 +373,15 @@ e.g.
{{ .Content }}
{{ 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
### readDir