A basic, barebones web app, intented to be used as a starting point for developing an Isomorphic Go application.

render.go 348B

1234567891011121314151617
  1. package view
  2. import (
  3. "html/template"
  4. "log"
  5. "net/http"
  6. )
  7. // Template rendering function
  8. func RenderTemplate(w http.ResponseWriter, templateFile string, templateData interface{}) {
  9. t, err := template.ParseFiles(templateFile)
  10. if err != nil {
  11. log.Fatal("Error encountered while parsing the template: ", err)
  12. }
  13. t.Execute(w, templateData)
  14. }