Skip to content

Commit dbbeeb5

Browse files
lx223povilasv
authored andcommitted
iss-1272: Fix concurrent writes when rendering html templates in ui (#1280)
1 parent 11d7798 commit dbbeeb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/ui/ui.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ func (bu *BaseUI) executeTemplate(w http.ResponseWriter, name string, prefix str
7575
return
7676
}
7777

78-
bu.tmplFuncs["pathPrefix"] = func() string { return prefix }
79-
80-
t, err := template.New("").Funcs(bu.tmplFuncs).Parse(text)
78+
t, err := template.New("").Funcs(bu.tmplFuncs).
79+
Funcs(template.FuncMap{"pathPrefix": func() string { return prefix }}).
80+
Parse(text)
8181
if err != nil {
8282
http.Error(w, err.Error(), http.StatusInternalServerError)
8383
return

0 commit comments

Comments
 (0)