Refactor template render (#36438)

This commit is contained in:
wxiaoguang
2026-01-24 13:11:49 +08:00
committed by GitHub
parent 47717d4435
commit 9de659437e
31 changed files with 475 additions and 459 deletions
@@ -61,6 +61,10 @@ func (t *ScopedTemplate) Freeze() {
t.all.Funcs(m)
}
func (t *ScopedTemplate) HasTemplate(name string) bool {
return t.all.Lookup(name) != nil
}
func (t *ScopedTemplate) Executor(name string, funcMap template.FuncMap) (TemplateExecutor, error) {
t.scopedMu.RLock()
scopedTmplSet, ok := t.scopedTemplateSets[name]