Go vet fixes.

This commit is contained in:
Aaron L
2015-03-16 14:51:44 -07:00
parent 99d0af8b72
commit 3d905f001f
5 changed files with 10 additions and 7 deletions
+3 -3
View File
@@ -317,15 +317,15 @@ func TestAuth_logoutHandlerFunc_GET(t *testing.T) {
} }
if val, ok := sessionStorer.Get(authboss.SessionKey); ok { if val, ok := sessionStorer.Get(authboss.SessionKey); ok {
t.Errorf("Unexpected session key:", val) t.Error("Unexpected session key:", val)
} }
if val, ok := sessionStorer.Get(authboss.SessionLastAction); ok { if val, ok := sessionStorer.Get(authboss.SessionLastAction); ok {
t.Errorf("Unexpected last action:", val) t.Error("Unexpected last action:", val)
} }
if val, ok := cookieStorer.Get(authboss.CookieRemember); ok { if val, ok := cookieStorer.Get(authboss.CookieRemember); ok {
t.Errorf("Unexpected rm cookie:", val) t.Error("Unexpected rm cookie:", val)
} }
if http.StatusFound != w.Code { if http.StatusFound != w.Code {
+1 -1
View File
@@ -159,7 +159,7 @@ func TestConfirm_ConfirmHandlerErrors(t *testing.T) {
err := c.confirmHandler(ctx, w, r) err := c.confirmHandler(ctx, w, r)
if err == nil { if err == nil {
t.Fatal("%d) Expected an error", i) t.Fatalf("%d) Expected an error", i)
} }
if !reflect.DeepEqual(err, test.Error) { if !reflect.DeepEqual(err, test.Error) {
+1 -1
View File
@@ -98,7 +98,7 @@ func TestAfterAuthFail_Lock(t *testing.T) {
t.Errorf("%d: StoreAttemptNumber set incorrectly: %v", i, val) t.Errorf("%d: StoreAttemptNumber set incorrectly: %v", i, val)
} }
if current, ok = storer.Users[email][StoreAttemptTime].(time.Time); !ok || old.After(current) { if current, ok = storer.Users[email][StoreAttemptTime].(time.Time); !ok || old.After(current) {
t.Error("%d: StoreAttemptTime not set correctly: %v", i, current) t.Errorf("%d: StoreAttemptTime not set correctly: %v", i, current)
} }
current = old current = old
+4 -1
View File
@@ -160,7 +160,10 @@ func TestOAuthSuccess(t *testing.T) {
ClientID: `jazz`, ClientID: `jazz`,
ClientSecret: `hands`, ClientSecret: `hands`,
Scopes: []string{`profile`, `email`}, Scopes: []string{`profile`, `email`},
Endpoint: oauth2.Endpoint{"fakeauth", "faketoken"}, Endpoint: oauth2.Endpoint{
AuthURL: "fakeauth",
TokenURL: "faketoken",
},
}, },
Callback: fakeCallback, Callback: fakeCallback,
AdditionalParams: url.Values{"include_requested_scopes": []string{"true"}}, AdditionalParams: url.Values{"include_requested_scopes": []string{"true"}},
+1 -1
View File
@@ -387,7 +387,7 @@ func TestUnbind_Valuer(t *testing.T) {
Count sql.NullInt64 Count sql.NullInt64
Time NullTime Time NullTime
}{ }{
sql.NullInt64{12, true}, sql.NullInt64{Int64: 12, Valid: true},
NullTime{nowTime, true}, NullTime{nowTime, true},
} }