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

Method MustGet

state.go:46–52  ·  view source on GitHub ↗

MustGet retrieves a value from the State and panics if the key is not found.

(key string)

Source from the content-addressed store, hash-verified

44
45// MustGet retrieves a value from the State and panics if the key is not found.
46func (s *State) MustGet(key string) any {
47 if dep, ok := s.Get(key); ok {
48 return dep
49 }
50
51 panic("state: dependency not found!")
52}
53
54// Has checks if a key is present in the State.
55// It returns a boolean indicating if the key is present.

Callers 2

TestState_MustGetFunction · 0.80
BenchmarkState_MustGetFunction · 0.80

Calls 1

GetMethod · 0.95

Tested by 2

TestState_MustGetFunction · 0.64
BenchmarkState_MustGetFunction · 0.64