mirror of
https://github.com/alexedwards/scs.git
synced 2025-07-13 01:00:17 +02:00
Add support for AllCtx() in Iterate()
This commit is contained in:
@ -325,7 +325,7 @@ func TestIterate(t *testing.T) {
|
||||
|
||||
results := []string{}
|
||||
|
||||
err := sessionManager.Iterate(func(ctx context.Context) error {
|
||||
err := sessionManager.Iterate(context.Background(), func(ctx context.Context) error {
|
||||
i := sessionManager.GetString(ctx, "foo")
|
||||
results = append(results, i)
|
||||
return nil
|
||||
@ -341,7 +341,7 @@ func TestIterate(t *testing.T) {
|
||||
t.Fatalf("unexpected value: got %v", results)
|
||||
}
|
||||
|
||||
err = sessionManager.Iterate(func(ctx context.Context) error {
|
||||
err = sessionManager.Iterate(context.Background(), func(ctx context.Context) error {
|
||||
return errors.New("expected error")
|
||||
})
|
||||
if err.Error() != "expected error" {
|
||||
|
Reference in New Issue
Block a user