This commit is contained in:
Anya Tokugawa committed 2026-05-19 21:30:42 +09:00
commit fa6a4c650f
93 files changed
+6555

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
package server
import (
"html/template"
"net/http"
)
func (s *Server) render(
w http.ResponseWriter,
name string,
data any,
) {
s.templates.Funcs(
template.FuncMap{
"sub": func(a, b int) int {
return a - b
},
},
)
err := s.templates.ExecuteTemplate(
w,
name,
data,
)
if err != nil {
http.Error(
w,
err.Error(),
500,
)
return
}
}