Change-Id: I1da668223b599867afe5483384b458482624adc5
GitHub-Last-Rev:
0a6bd6e84ac4c744d27d6ac87d877889209f386d
GitHub-Pull-Request: golang/go#69423
Reviewed-on: https://go-review.googlesource.com/c/go/+/612717
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
package template
import (
+ "maps"
"reflect"
"sync"
"text/template/parse"
}
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
}