diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-12 11:01:07 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-08-12 11:01:07 +0800 |
commit | dd6e40c759004c4c15944aed1289358bda038848 (patch) | |
tree | 02d0dd390a2d60d90f77106cce93befd85ca1b14 /forged/internal/unsorted/http_template.go | |
parent | Remove forge-specific functions from misc (diff) | |
download | forge-dd6e40c759004c4c15944aed1289358bda038848.tar.gz forge-dd6e40c759004c4c15944aed1289358bda038848.tar.zst forge-dd6e40c759004c4c15944aed1289358bda038848.zip |
Remove the mess
Diffstat (limited to 'forged/internal/unsorted/http_template.go')
-rw-r--r-- | forged/internal/unsorted/http_template.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/forged/internal/unsorted/http_template.go b/forged/internal/unsorted/http_template.go deleted file mode 100644 index db44e4c..0000000 --- a/forged/internal/unsorted/http_template.go +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only -// SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> - -package unsorted - -import ( - "log/slog" - "net/http" -) - -// renderTemplate abstracts out the annoyances of reporting template rendering -// errors. -func (s *Server) renderTemplate(w http.ResponseWriter, templateName string, params map[string]any) { - if err := s.templates.ExecuteTemplate(w, templateName, params); err != nil { - http.Error(w, "error rendering template: "+err.Error(), http.StatusInternalServerError) - slog.Error("error rendering template", "error", err.Error()) - } -} |