aboutsummaryrefslogtreecommitdiff
path: root/http_template.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--http_template.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/http_template.go b/http_template.go
index be175f1..377ad4c 100644
--- a/http_template.go
+++ b/http_template.go
@@ -8,8 +8,7 @@ import "net/http"
// render_template abstracts out the annoyances of reporting template rendering
// errors.
func render_template(w http.ResponseWriter, template_name string, params map[string]any) {
- err := templates.ExecuteTemplate(w, template_name, params)
- if err != nil {
+ if err := templates.ExecuteTemplate(w, template_name, params); err != nil {
http.Error(w, "Error rendering template: "+err.Error(), http.StatusInternalServerError)
}
}