MCPcopy
hub / github.com/grpc/grpc-go / newContextWithGlobalKey

Function newContextWithGlobalKey

benchmark/primitives/context_test.go:131–133  ·  view source on GitHub ↗
(parent context.Context)

Source from the content-addressed store, hash-verified

129var ck = ctxKey{}
130
131func newContextWithGlobalKey(parent context.Context) context.Context {
132 return context.WithValue(parent, ck, nil)
133}
134
135func BenchmarkContextWithValue(b *testing.B) {
136 benches := []struct {

Callers

nothing calls this directly

Calls 1

WithValueMethod · 0.80

Tested by

no test coverage detected