package web import ( "io" "log" "net/http" "strings" ) // handleGetRoot handles path / func handleGetRoot(w http.ResponseWriter, r *http.Request) { sw := &strings.Builder{} err := tmpl.ExecuteTemplate(sw, "home", nil) if err != nil { log.Println(err) w.WriteHeader(http.StatusInternalServerError) } else { w.WriteHeader(http.StatusOK) io.Copy(w, strings.NewReader(sw.String())) } }