| 1 | # Go package with improved reflect.DeepEqual |
| 2 | |
| 3 | [](LICENSE) |
| 4 | [](LICENSE-go) |
| 5 | [](https://go.dev/) |
| 6 | [](https://github.com/powerman/deepequal/actions/workflows/test.yml) |
| 7 | [](https://github.com/powerman/deepequal/actions/workflows/test.yml) |
| 8 | [](https://github.com/powerman/deepequal/releases/latest) |
| 9 | [](https://pkg.go.dev/github.com/powerman/deepequal) |
| 10 | |
| 11 |  |
| 12 |  |
| 13 |  |
| 14 | |
| 15 | Most of the code is copied from Go reflect package with slight |
| 16 | modifications. |
| 17 | |
| 18 | Differences from reflect.DeepEqual: |
| 19 | |
| 20 | - If compared value implements `.Equal(valueOfSameType) bool` method then |
| 21 | it will be called instead of comparing values as is. |
| 22 | - If called `Equal` method will panics then whole DeepEqual will panics too. |
| 23 | |
| 24 | This means you can use this DeepEqual method to correctly compare types |
| 25 | like time.Time or decimal.Decimal, without taking in account unimportant |
| 26 | differences (like time zone or exponent). |