An analysis.Analyzer that reports uses of reflect.DeepEqual in
tests.
DeepEqual is not configurable: unexported fields are always
compared, a nil slice never equals an empty one, and NaN never
equals itself. A comparator such as
go-cmp lets a test say what
equal means and shows what differed.
if !reflect.DeepEqual(a, b) { // avoid reflect.DeepEqual in tests; consider go-cmp
t.Errorf("got %v, want %v", a, b)
}Production (non-test) uses of reflect.DeepEqual are not
reported, and only package-qualified calls are matched — a dot
import or a function value is not.
go get -tool lesiw.io/testcmp/cmd/testcmp
go tool testcmp ./...