1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2024-12-27 00:12:31 +01:00
dnscrypt-proxy/vendor/github.com/powerman/deepequal
2021-09-24 09:30:49 +02:00
..
custom.go powerman update 2021-08-17 16:56:09 +02:00
deepequal.go powerman update 2021-08-17 16:56:09 +02:00
LICENSE powerman update 2021-08-17 16:56:09 +02:00
LICENSE-go powerman update 2021-08-17 16:56:09 +02:00
README.md powerman update 2021-08-17 16:56:09 +02:00
type.go powerman update 2021-08-17 16:56:09 +02:00
value.go powerman update 2021-08-17 16:56:09 +02:00

Go package with improved reflect.DeepEqual

Most of the code is copied from Go reflect package with slight modifications.

Differences from reflect.DeepEqual:

  • If compared value implements .Equal(valueOfSameType) bool method then it will be called instead of comparing values as is.
  • If called Equal method will panics then whole DeepEqual will panics too.

This means you can use this DeepEqual method to correctly compare types like time.Time or decimal.Decimal, without taking in account unimportant differences (like time zone or exponent).