tag | 72e5904921418dcd4dcf06b1dc8b525cbbc3d048 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon May 06 17:52:32 2024 -0700 |
object | 770afe2176838c9845ca6e6ce7e2ed96642f6c4b |
Android platform 13.0.0 release 19
commit | 770afe2176838c9845ca6e6ce7e2ed96642f6c4b | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Nov 01 21:23:24 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Tue Nov 01 21:23:24 2022 +0000 |
tree | 740cf616383317a58c11695d1c5cf7c47f4c6e79 | |
parent | 5966218054318edaba100b5988e66892fe655269 [diff] | |
parent | 88075998ddd97b3759d95f794fbbf554aba7ab86 [diff] |
Snap for 9239618 from 88075998ddd97b3759d95f794fbbf554aba7ab86 to tm-platform-release Change-Id: Idaab178ef9ad7f17e96dcbb40aad162a326b51c2
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