Repository: caddyserver/caddy (language: go)

Issue:
A bug of custom functions in templates
modules/caddyhttp/templates/templates.go
![image](https://user-images.githubusercontent.com/1589263/186051529-3e3f4e16-6a7e-4e63-ab00-dca56774833a.png)
This should be `customFuncs := make([]template.FuncMap, 0,len(fnModInfos))`


Discussion / hints:
Feel free to open a PR to fix it if you think it's a bug!
I believe that is a bug. Thanks! Please open a PR so you can get credit for it :)

Fix patch:
diff --git a/modules/caddyhttp/templates/templates.go b/modules/caddyhttp/templates/templates.go
index 85612ba07fd..40e5bbeb1c9 100644
--- a/modules/caddyhttp/templates/templates.go
+++ b/modules/caddyhttp/templates/templates.go
@@ -296,7 +296,7 @@ func (Templates) CaddyModule() caddy.ModuleInfo {
 // Provision provisions t.
 func (t *Templates) Provision(ctx caddy.Context) error {
 	fnModInfos := caddy.GetModules("http.handlers.templates.functions")
-	customFuncs := make([]template.FuncMap, len(fnModInfos), 0)
+	customFuncs := make([]template.FuncMap, 0, len(fnModInfos))
 	for _, modInfo := range fnModInfos {
 		mod := modInfo.New()
 		fnMod, ok := mod.(CustomFunctions)


Test patch: