format code

This commit is contained in:
Anton Lindström 2014-06-09 16:54:10 +00:00
parent 568eb0c1c5
commit 3ead5a545f
1 changed files with 2 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import (
"os" "os"
"testing" "testing"
) )
type headerOnlyResponseWriter http.Header type headerOnlyResponseWriter http.Header
func (ho headerOnlyResponseWriter) Header() http.Header { func (ho headerOnlyResponseWriter) Header() http.Header {
@ -67,7 +68,6 @@ func TestPGStore(t *testing.T) {
req.AddCookie(sessions.NewCookie(session.Name(), encoded, session.Options)) req.AddCookie(sessions.NewCookie(session.Name(), encoded, session.Options))
session, err = ss.Get(req, "mysess") session, err = ss.Get(req, "mysess")
if err != nil { if err != nil {
t.Fatal("failed to get round 2 session", err.Error()) t.Fatal("failed to get round 2 session", err.Error())
@ -77,12 +77,11 @@ func TestPGStore(t *testing.T) {
t.Fatal("Retrieved session had wrong value:", session.Values["counter"]) t.Fatal("Retrieved session had wrong value:", session.Values["counter"])
} }
session.Values["counter"] = 9 // set new value for round 3 session.Values["counter"] = 9 // set new value for round 3
if err = ss.Save(req, headerOnlyResponseWriter(m), session); err != nil { if err = ss.Save(req, headerOnlyResponseWriter(m), session); err != nil {
t.Fatal("Failed to save session:", err.Error()) t.Fatal("Failed to save session:", err.Error())
} }
// ROUND 2 - check that the cookie has been updated // ROUND 2 - check that the cookie has been updated
req, err = http.NewRequest("GET", "http://www.example.com", nil) req, err = http.NewRequest("GET", "http://www.example.com", nil)
if err != nil { if err != nil {
@ -100,6 +99,3 @@ func TestPGStore(t *testing.T) {
} }
} }