From d82a8c0c1a37f8395fc665150aa7a34da8dd974f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Fri, 14 Feb 2025 09:04:07 +0800 Subject: http_*.go: Abstract out render_template for deduplication --- http_handle_index.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'http_handle_index.go') diff --git a/http_handle_index.go b/http_handle_index.go index ee92c49..6a870c2 100644 --- a/http_handle_index.go +++ b/http_handle_index.go @@ -11,9 +11,5 @@ func handle_index(w http.ResponseWriter, r *http.Request, params map[string]any) return } params["groups"] = groups - err = templates.ExecuteTemplate(w, "index", params) - if err != nil { - http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError) - return - } + render_template(w, "index", params) } -- cgit v1.2.3