mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
tpl/collections: Fix description of apply function
The collections.Apply template function cannot be used with maps.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
916397320b
commit
dc2a544fac
@@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/gohugoio/hugo/tpl"
|
"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) {
|
func (ns *Namespace) Apply(ctx context.Context, c any, fname string, args ...any) (any, error) {
|
||||||
if c == nil {
|
if c == nil {
|
||||||
return make([]any, 0), nil
|
return make([]any, 0), nil
|
||||||
|
Reference in New Issue
Block a user