Skip to content

Commit f1cbf6e

Browse files
committed
.
1 parent 1944c07 commit f1cbf6e

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

pkg/templating/modules/container/container.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ func slicePush(_ *templating.Runtime, _ templating.Context, container []any, val
3939
return append(container, value)
4040
}
4141

42+
var sliceCreateFunc = modules.NewFunc("sliceCreate", sliceCreate)
43+
44+
func sliceCreate(_ *templating.Runtime, _ templating.Context, value ...any) []any {
45+
return []any{}
46+
}
47+
4248
var sliceCreateWithFunc = modules.NewFunc("sliceCreateWith", sliceCreateWith)
4349

4450
func sliceCreateWith(_ *templating.Runtime, _ templating.Context, value ...any) []any {
@@ -47,10 +53,10 @@ func sliceCreateWith(_ *templating.Runtime, _ templating.Context, value ...any)
4753
return value
4854
}
4955

50-
var sliceCreateFunc = modules.NewFunc("sliceCreate", sliceCreate)
56+
var mapCreateFunc = modules.NewFunc("mapCreate", mapCreate)
5157

52-
func sliceCreate(_ *templating.Runtime, _ templating.Context, value ...any) []any {
53-
return []any{}
58+
func mapCreate(_ *templating.Runtime, _ templating.Context) map[string]any {
59+
return map[string]any{}
5460
}
5561

5662
var mapCreateWithFunc = modules.NewFunc("mapCreateWith", mapCreateWith)
@@ -73,13 +79,6 @@ func mapCreateWith(_ *templating.Runtime, _ templating.Context, value ...any) ma
7379
return out
7480
}
7581

76-
var mapCreateFunc = modules.NewFunc("mapCreate", sliceCreate)
77-
78-
func mapCreate(_ *templating.Runtime, _ templating.Context, value ...any) map[string]any {
79-
return map[string]any{}
80-
}
81-
82-
8382
func hasKey(data any, key any) bool {
8483
val := reflect.ValueOf(data)
8584

0 commit comments

Comments
 (0)