(_ context.Context, key string, val []byte, _ time.Duration)
| 2601 | } |
| 2602 | |
| 2603 | func (s *flakySessionStorage) SetWithContext(_ context.Context, key string, val []byte, _ time.Duration) error { |
| 2604 | s.mu.Lock() |
| 2605 | defer s.mu.Unlock() |
| 2606 | if s.failSet { |
| 2607 | return errors.New("set failed") |
| 2608 | } |
| 2609 | s.data[key] = append([]byte(nil), val...) |
| 2610 | return nil |
| 2611 | } |
| 2612 | |
| 2613 | func (s *flakySessionStorage) Set(key string, val []byte, exp time.Duration) error { |
| 2614 | return s.SetWithContext(context.Background(), key, val, exp) |