(w http.ResponseWriter, r *http.Request, data any)
| 28 | ) |
| 29 | |
| 30 | func (h *Host) execTemplate(w http.ResponseWriter, r *http.Request, data any) { |
| 31 | tmplName := strings.TrimPrefix(fmt.Sprintf("%T", data), "importer.") |
| 32 | var buf bytes.Buffer |
| 33 | err := h.tmpl.ExecuteTemplate(&buf, tmplName, data) |
| 34 | if err != nil { |
| 35 | http.Error(w, fmt.Sprintf("Error executing template %q: %v", tmplName, err), 500) |
| 36 | return |
| 37 | } |
| 38 | w.Write(buf.Bytes()) |
| 39 | } |
| 40 | |
| 41 | type importersRootPage struct { |
| 42 | Title string |
no test coverage detected