Update module google/go-cmp to v0.5.0 #636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.4.1
->v0.5.0
Release Notes
google/go-cmp
v0.5.0
Compare Source
The most notable changes in this release are improvements to the reporter output (i.e., the implementation that produces output for
Diff
). The changes seek to improve the signal-to-noise ratio such that differences of interest to the user are emphasized, while information that is less relevant are de-emphasized.The reporter largely consists of a set of heuristics to determine what would be the best way to format the difference in the common case. If the output seems sub-par, please file an issue. The reports are highly valuable in improving its output (e.g., #195, #194, #202, #185).
Reporter changes:
strings.Join({...}, "\n")
syntax to show diffs between lines within a string. While this representation is unambiguous, the need to escape every line made the output visually distracting. Now, we add a new syntax where multiple lines are represented by a literal syntax using"""
as delimiters. When possible, this syntax is preferred if it can unambiguously represent the difference.cmp.Comparer(bytes.Equal)
so that large byte slices are compared using an efficient implementation. Previously, this would prevent the reporter from being able to use specialized logic to show the per-element difference between these two slices if they were different, but now it is able to.String
method, using fully qualified type names, or some combination of the above.1776240
) Forcibly export fields for use by the reporter. This allows the reporter to use theString
orError
method (if available) to format values within unexported fields. This occurs regardless of whether anycmp.Exporter
orcmp.AllowUnexported
options are used or not.Feature changes:
cmpopts.IgnoreFields
option now accepts unexported field names. Unlike exported fields, unexported field must be explicit specified as they do not respect forwarding due to struct embedding.Comparer changes:
cmp
package is intended for use primarily within tests where the expected outcome is generally equality. Previously, even if the result is equal,cmp.Diff
would construct an expensive diff tree only to discard the result since the values are equal. Now, optimize for the common case by first checking whether the values are equal first, and only construct a diff if they are not.unsafe
, it requires that the parent struct be addressable. In Go, a struct field is only addressable if and only if the parent struct is addressable. To avoid leaking this internal implementation detail, we shallow copy the result to remove properties of addressability.Renovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Enabled.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.