aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/templates/templates.go
diff options
context:
space:
mode:
authorjedy <[email protected]>2022-08-23 22:26:02 +0800
committerGitHub <[email protected]>2022-08-23 08:26:02 -0600
commite289ba6187ddd50afc86feb85246a14298673a69 (patch)
treed665de60c3d4e27769dd18db37bcafe2ce8fe06f /modules/caddyhttp/templates/templates.go
parenta22c08a6385772861173f21ebab3ac0b63796402 (diff)
downloadcaddy-e289ba6187ddd50afc86feb85246a14298673a69.tar.gz
caddy-e289ba6187ddd50afc86feb85246a14298673a69.zip
templates: cap of slice should not be smaller than length (#4975)
Diffstat (limited to 'modules/caddyhttp/templates/templates.go')
-rw-r--r--modules/caddyhttp/templates/templates.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/caddyhttp/templates/templates.go b/modules/caddyhttp/templates/templates.go
index 85612ba07..40e5bbeb1 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)