google/go-cmp
Package for comparing Go values in tests observed · 2026-10-15
Health v2 · maintenance only
59/100
- Activity 80
- Release rhythm 8
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3392
- days_rel: 606
- days_push: 124
- n_releases_24m: 1
Adoption not part of the score
4678 stars · 247 forks observed · 2026-10-15
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A Go library for comparing Go values in tests, intended as a more powerful and safer alternative to reflect.DeepEqual. It supports custom equality functions, Equal methods, and options for handling unexported fields.
Use cases
- compare two structs for equality in Go tests
- assert float values equal within a tolerance
- safer alternative to reflect.DeepEqual
- compare values with unexported fields in tests
- diff two Go values in unit tests
When to choose
- writing Go unit tests that need semantic value comparison
- you need custom equality logic like float tolerance
- you want readable diffs when values differ
When to avoid
- comparing values in production code rather than tests
- you only need shallow pointer equality
Facets
library · maturity stable
testing developer-tools testing developer-tools go cross-platform equality assertions go unit-testing deep-comparison
1 source
- readme: https://github.com/google/go-cmp · fetched 2026-10-15 · 3e5fc0993a11
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| google/go-cmp | main | 59 |
For agents
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem