Open dprotaso opened 1 year ago
Not really. The behavior of cmp.Diff
is to be symmetric such that the result of cmp.Equal(x, y)
and cmp.Equal(y, x)
are identical.
Functionally ignoring insertions implies an assymetric comparison, which is not something this package supports. Doing so would need to carefully think through the implications and how an asymmetric comparison would interact with existing cmp.Option
s that assume symmetric properties of equality.
@dsnet why is it renamed as x and y? I know many people do mistakes due to this, can't it be just got and want like in the shared example?
From https://github.com/google/go-cmp/blob/v0.5.9/cmp/compare.go#L113
Is there a way to ignore things added in
y
in the output? I realize I could post process the diff output and drop lines with+
but without the preceeding-
but wondering if there's a better way.