Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Created October 3, 2012 02:09
Show Gist options
  • Save ChimeraCoder/3824532 to your computer and use it in GitHub Desktop.
Save ChimeraCoder/3824532 to your computer and use it in GitHub Desktop.
Sample template info passing
func serveEventCreate(w http.ResponseWriter, r *http.Request, cred *oauth.Credentials){
if cred == nil {
respond(w, homeLoggedOutTmpl, nil)
} else {
respond(w, eventCreateTmpl, nil)
}
var twitter_id string
if err := getCookie(r, "twitter_id", &twitterInfo); err != nil {
http.Error(w, "Error getting twitter_id from cookie, "+err.Error(), 500)
return
}
twitter_id = strings.Join(twitterInfo, "")
//whatever you want to do
response(w, fooTemplate, twitter_id)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment