strings.TrimSpace
standard libraryThe 34th most-called standard-library function by production calls. Called 53,751 times across 1,117 modules; 38,408 of those run outside tests and generated code.
2% in production calls vs 2026-W39 (37,673 → 38,408)
- prod calls
- 38,408
- non-test, non-generated
- all calls
- 53,751
- total callsites
- modules
- 1,117
- distinct callers
- in loop
- 28%
- of prod calls
- in tests
- 28%
- 14,925 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.01× the estimated relative cost of fmt.Sprintf . Benchmarked at 6.13 ns/op × 38,408 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 TrimSpace from notable Go projects. Open one on the map to see what else it hammers.
- Kubernetes 1,059 3%
- Vault 809 2%
- Gitea 337 <1%
- Nomad 328 <1%
- HashiCorp 312 <1%
where it's called
Callsites in the wild
12 representative callsites of 53,751, prioritizing in-loop and non-test usage. We link to source, never display it.
- in loop
- in loop
-
liamstask/goose @v0.0.0-20150115234039-8488cc47d90c
lib/goose/migration_sql.go:64
in loop -
go/app @v0.2.0
appcmd/appcmdtesting/appcmdtesting.go:272
in loop -
go/standard @v0.1.0
xstrings/xstrings.go:39
in loop - in loop
-
cdr.dev/slog @v1.6.1
internal/entryhuman/entry.go:151
in loop -
charm.land/catwalk @v0.52.57
cmd/aihubmix/main.go:92
in loop -
fang/v2 @v2.0.1
help.go:234
in loop -
charm.land/fantasy @v0.45.2
schema/schema.go:163
in loop - in loop
-
ClickHouse/clickhouse-go/v2 @v2.48.0
in loop
top callers
The modules that reach for it
The modules that call TrimSpace most in this snapshot.
- github.com/esengine/DeepSeek-Reasonix4,7219%
- github.com/larksuite/cli2,8175%
- github.com/infiniflow/ragflow2,4235%
- github.com/Tencent/WeKnora2,2174%
- github.com/sipeed/picoclaw1,3022%
siblings
More from strings
The other most-called functions in this package. See all →