# google/go-cmp

Package for comparing Go values in tests

Repository: https://github.com/google/go-cmp
Canonical: https://ross.abutalabs.com/products/go-cmp
Language: Go
License: BSD-3-Clause
License Family: permissive
Topics: go, equality, testing
Last push: 2026-06-18T07:33:22+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 8, longevity 100
- inputs: {"age_days": 3344, "days_push": 76, "days_rel": 558, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4677, forks 240 (observed 2026-08-28T04:08:56.766702+00:00)

## What it is
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
- artifact type: library
- maturity: stable
- function: testing, developer-tools
- domain: testing, developer-tools
- platform: go, cross-platform
- tags: equality, assertions, go, unit-testing, deep-comparison

## Member repositories
- google/go-cmp (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:56.766702+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:19:21.128187+00:00, confidence not recorded.
  - readme: https://github.com/google/go-cmp (fetched 2026-08-28T04:08:56.766702+00:00, sha 3e5fc0993a11)
- Data as of 2026-08-30T08:39:29.467469+00:00.
