google/go-cmp
Package for comparing Go values in tests observed · 2026-08-28
Health v2 · maintenance only
62/100
- Activity 88
- 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-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3344
- days_rel: 558
- days_push: 76
- n_releases_24m: 1
Adoption not part of the score
4677 stars · 240 forks observed · 2026-08-28
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-08-28 · 3e5fc0993a11
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| google/go-cmp | main | 62 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem