Skip to content

Instantly share code, notes, and snippets.

View jaybill's full-sized avatar

Jaybill McCarthy jaybill

View GitHub Profile
@jaybill
jaybill / server.go
Created May 3, 2012 15:07
Type assertions on session values.
package main
import (
"encoding/gob"
"net/http"
"code.google.com/p/gorilla/sessions"
"log"
)
@jaybill
jaybill / server.go
Created May 2, 2012 15:21
gorilla sessions issue
package main
import (
"net/http"
"code.google.com/p/gorilla/sessions"
"log"
)
var store = sessions.NewCookieStore([]byte("something-very-secret"))
@jaybill
jaybill / server.go
Created April 25, 2012 21:29
Trailing slash forces GET method on request?
package main
import(
"net/http"
"log"
"fmt"
)
func route(pattern string, fn func(*http.Request) string){
http.HandleFunc(pattern,makeHandler(fn))