MCPcopy Index your code
hub / github.com/go-test/deep

github.com/go-test/deep @v1.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.1 ↗ · + Follow
66 symbols 174 edges 4 files 5 documented · 8% 51 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Deep Variable Equality for Humans

Go Report Card Coverage Status Go Reference

This package provides a single function: deep.Equal. It's like reflect.DeepEqual but much friendlier to humans (or any sentient being) for two reason:

  • deep.Equal returns a list of differences
  • deep.Equal does not compare unexported fields (by default)

reflect.DeepEqual is good (like all things Golang!), but it's a game of Hunt the Wumpus. For large maps, slices, and structs, finding the difference is difficult.

deep.Equal doesn't play games with you, it lists the differences:

package main_test

import (
    "testing"
    "github.com/go-test/deep"
)

type T struct {
    Name    string
    Numbers []float64
}

func TestDeepEqual(t *testing.T) {
    // Can you spot the difference?
    t1 := T{
        Name:    "Isabella",
        Numbers: []float64{1.13459, 2.29343, 3.010100010},
    }
    t2 := T{
        Name:    "Isabella",
        Numbers: []float64{1.13459, 2.29843, 3.010100010},
    }

    if diff := deep.Equal(t1, t2); diff != nil {
        t.Error(diff)
    }
}
$ go test
--- FAIL: TestDeepEqual (0.00s)
        main_test.go:25: [Numbers.slice[1]: 2.29343 != 2.29843]

The difference is in Numbers.slice[1]: the two values aren't equal using Go ==.

Core symbols most depended-on inside this repo

Shape

Function 38
Struct 17
Method 8
TypeAlias 3

Languages

Go100%

Modules by API surface

deep_test.go54 symbols
deep.go8 symbols
test/v2/errors.go2 symbols
test/v1/errors.go2 symbols

For agents

$ claude mcp add deep \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page