commit | 5996e935ac853c09f15e0c2bf69ebc561ce60db8 | [log] [tgz] |
---|---|---|
author | Bob Badour <bbadour@google.com> | Wed May 26 11:46:37 2021 -0700 |
committer | Bob Badour <bbadour@google.com> | Wed May 26 11:46:37 2021 -0700 |
tree | caabce3a169c3879096c0f4f171a9a76fa25c063 | |
parent | 58624c34adaf78ed2b01a5ef75c69e57df24eab9 [diff] |
[LSC] Add LOCAL_LICENSE_KINDS to external/go-cmp Added SPDX-license-identifier-BSD to: Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I986cbf13affb6752d52e3002bc01d37e32d3b52c
This package is intended to be a more powerful and safer alternative to reflect.DeepEqual
for comparing whether two values are semantically equal.
The primary features of cmp
are:
When the default behavior of equality does not suit the needs of the test, custom equality functions can override the equality operation. For example, an equality function may report floats as equal so long as they are within some tolerance of each other.
Types that have an Equal
method may use that method to determine equality. This allows package authors to determine the equality operation for the types that they define.
If no custom equality functions are used and no Equal
method is defined, equality is determined by recursively comparing the primitive kinds on both values, much like reflect.DeepEqual
. Unlike reflect.DeepEqual
, unexported fields are not compared by default; they result in panics unless suppressed by using an Ignore
option (see cmpopts.IgnoreUnexported
) or explicitly compared using the AllowUnexported
option.
See the documentation for more information.
This is not an official Google product.
go get -u github.com/google/go-cmp/cmp
BSD - See LICENSE file