Skip to content

Instantly share code, notes, and snippets.

@will3942
Created December 4, 2013 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will3942/7793232 to your computer and use it in GitHub Desktop.
Save will3942/7793232 to your computer and use it in GitHub Desktop.
Go: template
package main
import (
"html/template"
"net/http"
)
func handlerequest(w http.ResponseWriter, r *http.Request) {
title := "Hello World!"
t := template.New("index.html")
t, _ = t.ParseFiles("index.html")
t.Execute(w, title)
}
func main() {
http.HandleFunc("/", handlerequest)
http.ListenAndServe(":8000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment