diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 23:59:17 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 23:59:17 +0800 |
commit | 0c0062b22ff4ddac9cf8c4ef84116eddba99bce2 (patch) | |
tree | 2d1790cdf42b0dcdb3f82f77cea2b86fb7a42120 /http_handle_index.go | |
parent | scfg: Remove tests for now (diff) | |
download | forge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.tar.gz forge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.tar.zst forge-0c0062b22ff4ddac9cf8c4ef84116eddba99bce2.zip |
templates shall no longer be a global variable
Diffstat (limited to 'http_handle_index.go')
-rw-r--r-- | http_handle_index.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/http_handle_index.go b/http_handle_index.go index a1ecfe4..c1efd98 100644 --- a/http_handle_index.go +++ b/http_handle_index.go @@ -19,7 +19,7 @@ func (s *Server) httpHandleIndex(writer http.ResponseWriter, request *http.Reque groups, err = s.queryNameDesc(request.Context(), "SELECT name, COALESCE(description, '') FROM groups WHERE parent_group IS NULL") if err != nil { - web.ErrorPage500(templates, writer, params, "Error querying groups: "+err.Error()) + web.ErrorPage500(s.templates, writer, params, "Error querying groups: "+err.Error()) return } params["groups"] = groups @@ -28,5 +28,5 @@ func (s *Server) httpHandleIndex(writer http.ResponseWriter, request *http.Reque memstats := runtime.MemStats{} //exhaustruct:ignore runtime.ReadMemStats(&memstats) params["mem"] = humanize.IBytes(memstats.Alloc) - renderTemplate(writer, "index", params) + s.renderTemplate(writer, "index", params) } |