MCPcopy
hub / github.com/gofiber/fiber / GetWithContext

Method GetWithContext

middleware/csrf/csrf_test.go:2587–2597  ·  view source on GitHub ↗
(_ context.Context, key string)

Source from the content-addressed store, hash-verified

2585}
2586
2587func (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
2599func (s *flakySessionStorage) Get(key string) ([]byte, error) {
2600 return s.GetWithContext(context.Background(), key)

Callers 1

GetMethod · 0.95

Calls 3

LockMethod · 0.65
UnlockMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected