tag:github.com,2008:https://github.com/google/go-cmp/releases Tags from go-cmp 2025-01-14T18:15:44Z tag:github.com,2008:Repository/96570421/v0.7.0 2025-02-21T20:41:08Z v0.7.0 <p>Detect proto.Message types when failing to export a field (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/370">#370</a>)</p> <p>While we do not provide 1st class handling of protobuf messages, <br />we can at least detect whether the type is a proto.Message <br />and refer the user to the correct package to use to handle <br />protobuf messages with cmp.Equal.</p> dsnet tag:github.com,2008:Repository/96570421/v0.6.0 2023-10-10T16:38:52Z v0.6.0 <p>Add cmpopts.EquateComparable (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/340">#340</a>)</p> <p>This helper function makes it easier to specify that comparable types <br />are safe to directly compare with the == operator in Go.</p> <p>The API does not use generics as it follows existing options like <br />cmp.AllowUnexported, cmpopts.IgnoreUnexported, or cmpopts.IgnoreTypes.</p> <p>While generics provides type safety, the user experience is not as nice. <br />Our current API allows multiple types to be specified: <br /> cmpopts.EquateComparable(netip.Addr{}, netip.Prefix{}) <br />While generics would not allow variadic arguments: <br /> cmpopts.EquateComparable[netip.Addr]() <br /> cmpopts.EquateComparable[netip.Prefix]()</p> <p>Bump mininimum supported Go to 1.18 for net/netip type. <br />Start testing on Go 1.21.</p> <p><span class="issue-keyword tooltipped tooltipped-se">Fixes</span> <a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/issues/339">#339</a></p> dsnet tag:github.com,2008:Repository/96570421/v0.5.9 2022-09-08T08:04:11Z v0.5.9 <p>Adjust heuristic for line-based versus byte-based diffing (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/299">#299</a>)</p> <p>If the string has many characters that require escape sequences to print, <br />then we need to take that into consideration and avoid byte-by-byte diffing.</p> <p>Co-authored-by: Damien Neil &lt;[email protected]&gt;</p> dsnet tag:github.com,2008:Repository/96570421/v0.5.8 2022-04-26T20:56:36Z v0.5.8 dsnet tag:github.com,2008:Repository/96570421/v0.5.7 2022-01-19T19:32:01Z v0.5.7 <p>Add //go:build lines (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/285">#285</a>)</p> <p>Starting with Go 1.17, //go:build lines are preferred over // +build <br />lines, see <a href="https://golang.org/doc/go1.17#build-lines">https://golang.org/doc/go1.17#build-lines</a> and <br /><a href="https://golang.org/design/draft-gobuild">https://golang.org/design/draft-gobuild</a> for details.</p> <p>This change was generated by running Go 1.17 go fmt ./... which <br />automatically adds //go:build lines based on the existing // +build <br />lines.</p> <p>Also update the corresponding GitHub action to use Go 1.17 gofmt.</p> dsnet tag:github.com,2008:Repository/96570421/v0.5.6 2021-05-25T02:54:00Z v0.5.6 <p>Print as text if mostly text (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/258">#258</a>)</p> <p>The previous heuristic of treating strings as binary data <br />if it contains any invalid UTF-8 was too strict. <br />Loosen the heuristic to check if most of the characters <br />are printable text.</p> <p><span class="issue-keyword tooltipped tooltipped-se">Fixes</span> <a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/issues/257">#257</a></p> dsnet tag:github.com,2008:Repository/96570421/v0.5.5 2021-03-04T16:36:09Z v0.5.5 <p>Fix reporter verbosity bug (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/253">#253</a>)</p> <p>FormatDiff should only set the verbosity to 3 if the current verbosity <br />is lower than 3. Otherwise, it may remove an intended higher verbosity <br />setting causing the reporter output to not differentiate between <br />two large values that are different at the end.</p> <p>While we are at it, increase the maxVerbosityPreset to 6.</p> dsnet tag:github.com,2008:Repository/96570421/v0.5.4 2020-11-24T18:49:09Z v0.5.4 <p>Impose verbosity limit when formatting map keys (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/248">#248</a>)</p> <p>Map keys should have a sensible verbosity limit imposed, <br />otherwise the reporter can end up printing a massive data structure <br />that cannot reasonably fit in memory.</p> dsnet tag:github.com,2008:Repository/96570421/v0.5.3 2020-11-12T20:29:58Z v0.5.3 <p>Fix Diff documentation (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/237">#237</a>)</p> <p>The description inaccurately describes the operation of Diff, <br />which is y - x, where a '+' prefix denotes elements added from y <br />and a '-' prefix denotes elements removed from x.</p> <p>For example: <br /> // Consider this call to Diff and its result. <br /> x y <br /> cmp.Diff({b:2, c:3}, {a:1, b:2}) =&gt; {+a:1, b:2, -c:3}</p> <p> // Consider the same in mathematical notation. <br /> y - x <br /> {a:1, b:2} - {b:2, c:3} = {+a:1, b:2, -c:3}</p> dsnet tag:github.com,2008:Repository/96570421/v0.5.2 2020-08-25T06:48:38Z v0.5.2 <p>Suggest use of cmpopts.EquateErrors (<a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/pull/234">#234</a>)</p> <p>If cmp panics because it is trying to access an unexported field, <br />specially suggest the use of cmpopts.EquateErrors if the parent type <br />implements the error interface.</p> <p><span class="issue-keyword tooltipped tooltipped-se">Fixes</span> <a class="issue-link js-issue-link" href="https://github.com/google/go-cmp/issues/233">#233</a></p> dsnet