refactor: inline variable
1 file changed, 1 insertion(+), 3 deletions(-)
changed files
M internal/server/source.go → internal/server/source.go
@@ -27,8 +27,6 @@ h.global.Search(h.source, w, r) } func (h *SourceHandler) Detail(w http.ResponseWriter, r *http.Request) { - importerSingular := h.source.Importer.Singular() - doc, err := h.global.index.GetDocument(r.Context(), h.source, r.PathValue("id")) if err != nil { if ftag.Get(err) == ftag.NotFound {@@ -77,7 +75,7 @@ } else { baseErr = components.DetailPage(tdata, doc).Render(w) } if baseErr != nil { - h.global.log.Error("template error", "template", importerSingular, "error", baseErr) + h.global.log.Error("template error", "template", h.source.Importer.Singular(), "error", baseErr) h.global.errorHandler(w, r, baseErr.Error(), http.StatusInternalServerError) } }