context.WithValue
standard libraryThe 306th most-called standard-library function by production calls. Called 7,091 times across 512 modules; 3,006 of those run outside tests and generated code.
2% in production calls vs 2026-W37 (2,950 → 3,006)
- prod calls
- 3,006
- non-test, non-generated
- all calls
- 7,091
- total callsites
- modules
- 512
- distinct callers
- in loop
- 3%
- of prod calls
- in tests
- 33%
- 2,308 calls
- resolved
- 100%
- to a known target
resolution mix
How each call resolves
How each call was attributed. Only resolved kinds, where the target function is known, count toward the ranking. Interface dispatch and unresolved receivers are reported separately and never guessed. Read the taxonomy →
- Package function100%A direct call to an exported package function, resolved by type.
estimate
Estimated relative cost
Roughly 0.00× the estimated relative cost of fmt.Sprintf . Benchmarked at 21.4 ns/op × 3,006 production calls, normalized so fmt.Sprintf = 1.0.
This is not dollars and not a verdict. Per-op time depends heavily on inputs (argument sizes, contention, patterns), the benchmark ran on a single machine (darwin/arm64 (Apple Silicon), go1.26.0), and static call counts are not runtime frequency. How this is estimated →
who calls this
Notable callers
Production calls into WithValue from notable Go projects. Open one on the map to see what else it hammers.
- Grafana 78 3%
- gRPC 46 2%
- Kubernetes 38 1%
- Docker 36 1%
- containerd 30 <1%
where it's called
Callsites in the wild
12 representative callsites of 7,091, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
-
docker/distribution @v2.8.3+incompatible
in loop - in loop
- in loop
- in loop
-
ardanlabs/gotraining @v0.0.0-20260512011504-4ae5a46bfc66
in loop -
cadence-workflow/shard-manager @v0.0.0-20260921113454-c8c42965630b
in loop -
cloudreve/cloudreve @v0.0.0-20200909065614-40414fe6ae9f
in loop - in loop
-
distribution/distribution @v2.8.3+incompatible
in loop - in loop
- in loop
top callers
The modules that reach for it
The modules that call WithValue most in this snapshot.
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v773210%
- knative.dev/pkg5538%
- github.com/Tencent/WeKnora3555%
- github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v73144%
- github.com/gateio/gateapi-go/v62824%
siblings
More from context
The other most-called functions in this package. See all →