Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.github/workflows/ | H | 25-Apr-2025 | - | 22 | 21 | |
cmp/ | H | 25-Apr-2025 | - | 14,472 | 11,900 | |
Android.bp | H A D | 25-Apr-2025 | 388 | 19 | 16 | |
Android.gen.bp | H A D | 25-Apr-2025 | 3.3 KiB | 136 | 125 | |
CONTRIBUTING.md | H A D | 25-Apr-2025 | 969 | 24 | 17 | |
LICENSE | H A D | 25-Apr-2025 | 1.4 KiB | 28 | 24 | |
METADATA | H A D | 25-Apr-2025 | 456 | 20 | 19 | |
MODULE_LICENSE_BSD | HD | 25-Apr-2025 | 0 | |||
README.md | H A D | 25-Apr-2025 | 1.7 KiB | 45 | 30 | |
go.mod | H A D | 25-Apr-2025 | 41 | 4 | 2 |
README.md
1# Package for equality of Go values 2 3[][godev] 4[][actions] 5 6This package is intended to be a more powerful and safer alternative to 7`reflect.DeepEqual` for comparing whether two values are semantically equal. 8 9The primary features of `cmp` are: 10 11* When the default behavior of equality does not suit the needs of the test, 12 custom equality functions can override the equality operation. 13 For example, an equality function may report floats as equal so long as they 14 are within some tolerance of each other. 15 16* Types that have an `Equal` method may use that method to determine equality. 17 This allows package authors to determine the equality operation for the types 18 that they define. 19 20* If no custom equality functions are used and no `Equal` method is defined, 21 equality is determined by recursively comparing the primitive kinds on both 22 values, much like `reflect.DeepEqual`. Unlike `reflect.DeepEqual`, unexported 23 fields are not compared by default; they result in panics unless suppressed 24 by using an `Ignore` option (see `cmpopts.IgnoreUnexported`) or explicitly 25 compared using the `AllowUnexported` option. 26 27See the [documentation][godev] for more information. 28 29This is not an official Google product. 30 31[godev]: https://pkg.go.dev/github.com/google/go-cmp/cmp 32[actions]: https://github.com/google/go-cmp/actions 33 34## Install 35 36``` 37go get -u github.com/google/go-cmp/cmp 38``` 39 40## License 41 42BSD - See [LICENSE][license] file 43 44[license]: https://github.com/google/go-cmp/blob/master/LICENSE 45