Skip to content

Commit

Permalink
tpl/collections: Fix description of apply function
Browse files Browse the repository at this point in the history
The collections.Apply template function cannot be used with maps.
  • Loading branch information
jmooring authored and bep committed Jul 28, 2023
1 parent 9163973 commit dc2a544
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tpl/collections/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc2a544

Please sign in to comment.