MCPcopy
hub / github.com/google/go-cmp / Equal

Function Equal

cmp/compare.go:95–99  ·  cmp/compare.go::Equal

TODO(≥go1.18): Use any instead of interface{}. Equal reports whether x and y are equal by recursively applying the following rules in the given order to x and y and all of their sub-values: - Let S be the set of all [Ignore], [Transformer], and [Comparer] options that remain after applying all path

(x, y interface{}, opts ...Option)

Source from the content-addressed store, hash-verified

93// If there is a cycle, then the pointed at values are considered equal
94// only if both addresses were previously visited in the same path step.
95func Equal(x, y interface{}, opts ...Option) bool {
96 s := newState(opts)
97 s.compareAny(rootStep(x, y))
98 return s.result.Equal()
99}
100
101// Diff returns a human-readable report of the differences between two values:
102// y - x. It returns an empty string if and only if Equal returns true for the

Callers 11

ExampleReporterFunction · 0.92
project3TestsFunction · 0.92
BenchmarkBytesFunction · 0.92
ExampleOption_equalNaNsFunction · 0.92
ExampleOption_equalEmptyFunction · 0.92
TestOptionsFunction · 0.92

Calls 4

newStateFunction · 0.85
rootStepFunction · 0.85
compareAnyMethod · 0.80
EqualMethod · 0.65

Tested by 11

ExampleReporterFunction · 0.74
project3TestsFunction · 0.74
BenchmarkBytesFunction · 0.74
ExampleOption_equalNaNsFunction · 0.74
ExampleOption_equalEmptyFunction · 0.74
TestOptionsFunction · 0.74