Skip to content

Instantly share code, notes, and snippets.

@goldalworming
Created October 8, 2015 10:30
Show Gist options
  • Save goldalworming/80633bfda6df4a3ca595 to your computer and use it in GitHub Desktop.
Save goldalworming/80633bfda6df4a3ca595 to your computer and use it in GitHub Desktop.
func pasteHandler(w http.ResponseWriter, r *http.Request) {
paste_id := strings.TrimPrefix(r.URL.Path, "/paste")
paste := &Paste{UUID: paste_id}
keep_alive := false
burn_after_reading := false
data := struct {
Paste *Paste
KeepAlive bool
BurnAfterReading bool
} {
paste,
keep_alive,
burn_after_reading,
}
t, _ := template.ParseFiles("templates/paste.html")
t.Execute(w, data)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment