]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/collections: Fix description of apply function
authorJoe Mooring <joe.mooring@veriphor.com>
Thu, 20 Jul 2023 19:29:25 +0000 (12:29 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 28 Jul 2023 07:51:01 +0000 (09:51 +0200)
The collections.Apply template function cannot be used with maps.

tpl/collections/apply.go

index 1dc09c8e51ac53e5f77c1430a6c3d8854b4c3d5a..397ba0fdb663727b9924e23e4e087c876190145b 100644 (file)
@@ -24,7 +24,7 @@ import (
        "github.com/gohugoio/hugo/tpl"
 )
 
-// Apply takes a map, array, or slice c and returns a new slice with the function fname applied over it.
+// Apply takes an array or slice c and returns a new slice with the function fname applied over it.
 func (ns *Namespace) Apply(ctx context.Context, c any, fname string, args ...any) (any, error) {
        if c == nil {
                return make([]any, 0), nil