awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
google avatar

google/go-cmp

0
View on GitHub↗

Go Cmp

go-cmp is a value comparison library for Go designed for use in test suites. It functions as a recursive data differ and assertion tool that determines if two complex data structures are semantically equal rather than relying on strict bitwise equality.

The library provides a framework for defining specialized comparison logic, allowing users to register custom equality overrides for specific types. It includes mechanisms to manage how unexported fields are handled during traversal to prevent runtime panics during deep equality checks.

The system utilizes reflection-based value traversal to identify specific mismatches between expected and actual values, producing detailed differences when values do not match. It supports type-specific equality dispatch and configurable comparison behavior.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Features

  • Recursive Semantic Equality - Determines if two complex data structures are semantically equal by recursively comparing their components.
  • Reflection-Based Comparison - Uses Go reflection to recursively walk through complex data structures for deep equality checks.
  • Equality Logic Frameworks - Provides a configurable framework for implementing specialized comparison logic and handling unexported fields.
  • Unexported Field Access Control - Manages reflection access to unexported fields to prevent runtime panics during deep equality checks.
  • Comparison Logic Overrides - Provides a framework for registering custom functions to replace default equality logic for specific types.
  • Custom Equality Definitions - Allows the definition of custom comparison functions to handle special cases like floating-point tolerances.
  • Recursive Data Diffing - Traverses Go types recursively to identify and produce detailed mismatches between expected and actual values.
  • Semantic Value Comparison - Determines if two values are semantically equal by recursively comparing primitive types or applying specialized logic.
  • Go Testing Frameworks - Serves as a specialized assertion tool for Go that generates detailed diffs between expected and actual values.
  • Private Field Comparison Controls - Provides capabilities to manage whether unexported fields are included in value comparisons during testing.
  • Unexported Field Handling - Manages how private struct fields are treated during comparison to prevent panics in Go test suites.
  • Value Comparison Libraries - Compares complex Go data structures in tests using semantic equality instead of strict bitwise equality.
  • Object Equality Implementations - Supports defining specific equality methods on types to control how their equality is calculated.
  • Special Type Equality Handlers - Routes comparison logic to special handlers based on the concrete type of the values.
  • Functional Options - Implements the functional options pattern to configure complex comparison settings via variadic functions.
  • Custom Assertions - Enables specialized equality rules for types to handle business logic or floating point precision during verification.
  • Unit Testing - Facilitates the verification of complex data structures within Go unit tests.
  • Testing and QA - Package for comparing Go values in tests.
  • Testing and Quality Assurance - Package for deep comparison of Go values.
  • Testing Frameworks - Package for comparing Go values in tests.
4,651 stars·224 forks·Go·BSD-3-Clause·15 views

Star history

Star history chart for google/go-cmpStar history chart for google/go-cmp

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

Frequently asked questions

What does google/go-cmp do?

go-cmp is a value comparison library for Go designed for use in test suites. It functions as a recursive data differ and assertion tool that determines if two complex data structures are semantically equal rather than relying on strict bitwise equality.

What are the main features of google/go-cmp?

The main features of google/go-cmp are: Recursive Semantic Equality, Reflection-Based Comparison, Equality Logic Frameworks, Unexported Field Access Control, Comparison Logic Overrides, Custom Equality Definitions, Recursive Data Diffing, Semantic Value Comparison.

Which projects share features with google/go-cmp?

Projects with overlapping indexed features include: smartystreets/goconvey — GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code… chaijs/chai — Chai is an assertion library for Node.js and browser-based JavaScript applications. It functions as both a… sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… appleboy/gofight — Testing API Handler written in Golang. adamluzsi/testcase — testcase is an opinionated testing framework to support test driven design. bradleyjkemp/cupaloy — Simple Go snapshot testing.

Projects sharing features with Go Cmp

These projects share indexed features with Go Cmp. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • smartystreets/goconveysmartystreets avatar

    smartystreets/goconvey

    8,415View on GitHub↗

    GoConvey is a behavioral testing framework for the Go programming language that provides a test runner, a code coverage tool, and a web-based monitoring dashboard. It integrates with the standard Go test command to organize tests into behavioral stories and conveyors. The project features a web interface that monitors the file system for source code changes and automatically triggers test execution to provide real-time feedback. This dashboard displays test results, failures, and a chronological history of execution status. The framework includes a state assertion system for verifying values

    Go
    View on GitHub↗8,415
  • chaijs/chaichaijs avatar

    chaijs/chai

    8,264View on GitHub↗

    Chai is an assertion library for Node.js and browser-based JavaScript applications. It functions as both a behavior-driven development and test-driven development framework, providing a system to verify code outputs, application state, and general logic. The project is an extensible validation engine that uses a plugin-based system to allow the registration of custom assertions and specialized data checks. It supports multiple modular assertion styles to accommodate different validation philosophies. The library covers a broad range of data validation capabilities, including the inspection o

    JavaScript
    View on GitHub↗8,264
  • sinonjs/sinonsinonjs avatar

    sinonjs/sinon

    9,753View on GitHub↗

    Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes. The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between tes

    JavaScript
    View on GitHub↗9,753
  • bradleyjkemp/cupaloybradleyjkemp avatar

    bradleyjkemp/cupaloy

    333View on GitHub↗

    Simple Go snapshot testing

    Go
    View on GitHub↗333
Compare all 30 related projects→