Change store All to use channel
This commit is contained in:
@@ -25,8 +25,12 @@ func testLoginAttemptStore(s store.LoginAttemptStore, t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Error getting all attempts: %s", err)
|
||||
}
|
||||
if len(all) != len(testAttempts) {
|
||||
t.Errorf("All returned wrong amount. Got %d want %d", len(all), len(testAttempts))
|
||||
var count int
|
||||
for range all {
|
||||
count++
|
||||
}
|
||||
if count != len(testAttempts) {
|
||||
t.Errorf("All returned wrong amount. Got %d want %d", count, len(testAttempts))
|
||||
}
|
||||
stats, err := s.Stats(store.LoginStatsTotals, 1)
|
||||
if err != nil {
|
||||
@@ -229,7 +233,11 @@ func benchmarkLoginAttemptStore(setupFunc func() store.LoginAttemptStore, b *tes
|
||||
if err != nil {
|
||||
b.Fatalf("Error fetchin all: %s", err)
|
||||
}
|
||||
_ = len(all)
|
||||
var count int
|
||||
for range all {
|
||||
count++
|
||||
}
|
||||
_ = count
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user