aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/text/template/template.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/text/template/template.go b/src/text/template/template.go
index 86fd3f122a..78067af2ad 100644
--- a/src/text/template/template.go
+++ b/src/text/template/template.go
@@ -5,6 +5,7 @@
package template
import (
+ "maps"
"reflect"
"sync"
"text/template/parse"
@@ -102,12 +103,8 @@ func (t *Template) Clone() (*Template, error) {
}
t.muFuncs.RLock()
defer t.muFuncs.RUnlock()
- for k, v := range t.parseFuncs {
- nt.parseFuncs[k] = v
- }
- for k, v := range t.execFuncs {
- nt.execFuncs[k] = v
- }
+ maps.Copy(nt.parseFuncs, t.parseFuncs)
+ maps.Copy(nt.execFuncs, t.execFuncs)
return nt, nil
}