fmt.Errorf
standard libraryThe 1st most-called standard-library function by production calls. Called 570,823 times across 1,565 modules; 375,541 of those run outside tests and generated code.
2% in production calls vs 2026-W37 (366,492 → 375,541)
- prod calls
- 375,541
- non-test, non-generated
- all calls
- 570,823
- total callsites
- modules
- 1,565
- distinct callers
- in loop
- 15%
- of prod calls
- in tests
- 7%
- 40,016 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 2.1× the estimated relative cost of fmt.Sprintf . Benchmarked at 138.3 ns/op × 375,541 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 Errorf from notable Go projects. Open one on the map to see what else it hammers.
- Kubernetes 32,361 9%
- Grafana 7,098 2%
- containerd 7,016 2%
- VictoriaMetrics 6,569 2%
- Cilium 5,632 1%
where it's called
Callsites in the wild
12 representative callsites of 570,823, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
- in loop
-
go/app @v0.2.0
appext/name_container.go:130
in loop -
go/bufplugin @v0.10.0
check/checkutil/util.go:37
in loop -
go/protovalidate @v1.4.0
builder.go:185
in loop -
go/spdx @v0.2.0
internal/cmd/gen-spdx-go/main.go:138
in loop -
go/standard @v0.1.0
xslices/xslices.go:225
in loop -
CCTV/age @v0.0.0-20260829155415-4448f2097b2d
internal/bech32/bech32.go:86
in loop - in loop
-
charm.land/fantasy @v0.44.0
model_json.go:41
in loop -
glamour/v2 @v2.0.1
ansi/emphasis.go:37
in loop -
lipgloss/v2 @v2.0.6
terminal.go:103
in loop
top callers
The modules that reach for it
The modules that call Errorf most in this snapshot.
- github.com/elastic/go-elasticsearch/v821,8204%
- github.com/kubernetes/kubernetes20,4944%
- github.com/gogo/protobuf11,5162%
- github.com/DataDog/datadog-api-client-go/v210,6712%
- github.com/infiniflow/ragflow8,8042%
siblings
More from fmt
The other most-called functions in this package. See all →