MCPcopy Create free account
hub / github.com/golang/appengine / WithCallOverride

Function WithCallOverride

internal/api_common.go:27–36  ·  view source on GitHub ↗
(ctx context.Context, f CallOverrideFunc)

Source from the content-addressed store, hash-verified

25var callOverrideKey = "holds []CallOverrideFunc"
26
27func WithCallOverride(ctx context.Context, f CallOverrideFunc) context.Context {
28 // We avoid appending to any existing call override
29 // so we don't risk overwriting a popped stack below.
30 var cofs []CallOverrideFunc
31 if uf, ok := ctx.Value(&callOverrideKey).([]CallOverrideFunc); ok {
32 cofs = append(cofs, uf...)
33 }
34 cofs = append(cofs, f)
35 return context.WithValue(ctx, &callOverrideKey, cofs)
36}
37
38func callOverrideFromContext(ctx context.Context) (CallOverrideFunc, context.Context, bool) {
39 cofs, _ := ctx.Value(&callOverrideKey).([]CallOverrideFunc)

Callers 4

WithAPICallFuncFunction · 0.92
newFakeContextFunction · 0.92
NewContextMethod · 0.92
FakeSingleContextFunction · 0.92

Calls 1

ValueMethod · 0.45

Tested by 1

newFakeContextFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…