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_repo_commit.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'http_handle_repo_commit.go') diff --git a/http_handle_repo_commit.go b/http_handle_repo_commit.go index ee21f16..2732b4e 100644 --- a/http_handle_repo_commit.go +++ b/http_handle_repo_commit.go @@ -79,11 +79,8 @@ func handle_repo_commit(w http.ResponseWriter, r *http.Request, params map[strin } params["file_patches"] = usable_file_patches - err = templates.ExecuteTemplate(w, "repo_commit", params) - if err != nil { - http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError) - return - } + render_template(w, "repo_commit", params) + return } type fake_diff_file struct { -- cgit v1.2.3