(_ context.Context, key string)
| 2585 | } |
| 2586 | |
| 2587 | func (s *flakySessionStorage) GetWithContext(_ context.Context, key string) ([]byte, error) { |
| 2588 | s.mu.Lock() |
| 2589 | defer s.mu.Unlock() |
| 2590 | if s.failGet { |
| 2591 | return nil, errors.New("get failed") |
| 2592 | } |
| 2593 | if val, ok := s.data[key]; ok { |
| 2594 | return append([]byte(nil), val...), nil |
| 2595 | } |
| 2596 | return nil, nil |
| 2597 | } |
| 2598 | |
| 2599 | func (s *flakySessionStorage) Get(key string) ([]byte, error) { |
| 2600 | return s.GetWithContext(context.Background(), key) |