(_ context.Context, key string, val []byte, _ time.Duration)
| 148 | } |
| 149 | |
| 150 | func (s *failingCacheStorage) SetWithContext(_ context.Context, key string, val []byte, _ time.Duration) error { |
| 151 | s.mu.Lock() |
| 152 | defer s.mu.Unlock() |
| 153 | if err, ok := s.errs["set|"+key]; ok && err != nil { |
| 154 | return err |
| 155 | } |
| 156 | s.data[key] = append([]byte(nil), val...) |
| 157 | return nil |
| 158 | } |
| 159 | |
| 160 | func (s *failingCacheStorage) Set(key string, val []byte, exp time.Duration) error { |
| 161 | return s.SetWithContext(context.Background(), key, val, exp) |