go-cmp v0.3.0 Release Notes
Release Date: 2019-04-29 // almost 5 years ago-
โ Added features:
- (#108) The
_
field is always ignored when comparing a struct. - (#109) The naming rules for
cmp.Transformer
is relaxed and clearly specified. - (#82)
cmpopts.AcyclicTransformer
makes it easier to write a transformer that avoids infinite recursion when the output type contains the input type. - (#126)
cmpopts.IgnoreSliceElements
andcmpopts.IgnoreMapEntries
provide the ability to ignore specific slice elements or map entries. - (#123)
cmp.Reporter
provides users the ability to add custom difference reporters. - (#119)
cmp.PathStep.Values
provide the currentreflect.Value
for thex
andy
arguments at that given path step.
๐ Bug fixes:
- ๐ (#87) Fixed proper comparing of slices where one is a sub-slice of the other.
Reporter changes:
- โ
(#124) The
cmp.Diff
output has been completely re-written to provide a unified diff of the two Go objects as a literal in pseudo-Go syntax (example). - 0๏ธโฃ (#131) The default reporter has built-in heuristics to detect whether a string or a byte-slice looks like binary data or human readable text, and can provide more humanly readable differences in certain use-cases. For example, a string may be detecting as containing multiple lines of text, for which it will print the difference based on the lines.
- (#108) The