You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe even more interesting for me would be to have CustomCompare like below which would allow this lib to be kept "pure".
I am also using something like getUUIDByName("my_cool_uuid_name") in my tests and this would allow to match uuids back to "my_cool_uuid_name" for even better readability.
// NilMapsAreEmpty causes a nil map to be equal to an empty map.
NilMapsAreEmpty = false
// CustomCompare allows to implement custom behaviour for specific type
// and should return if type was handled and what is difference between a and b
CustomCompare func(abType reflect.Type, a, b reflect.Value) (
bool, *string, *string) = nil
...
if CustomCompare != nil {
handled, aDiff, bDiff := CustomCompare(aType, a, b)
if handled {
if aDiff != nil || bDiff != nil {
c.saveDiff(getNilOrValue(aDiff), getNilOrValue(bDiff))
}
return
}
}
The text was updated successfully, but these errors were encountered:
Something like CustomCompare might work. Can you do a PR to see how it looks and feels? (I'll try to think of a more precise or representative name for the func because "custom" is very vague, but naming things is difficult.)
Currently comparing two "github.com/google/uuid" is not really readable since it is checked as array and looks like this:
or we can get following test:
Would it be maybe interesting to implement something like following or is it preferred to not mix other types?
Maybe even more interesting for me would be to have
CustomCompare
like below which would allow this lib to be kept "pure".I am also using something like
getUUIDByName("my_cool_uuid_name")
in my tests and this would allow to match uuids back to"my_cool_uuid_name"
for even better readability.The text was updated successfully, but these errors were encountered: