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
Unfortunately it will be very difficult to me to use time.Time.Equal(), because my struct (in my real code) has several fields. reflect.DeepEqual() is more convenient. (I want to compare all the struct values)
Is it possible to change reflect.DeepEqual to make it use time.Time.Equal() ?
I understand perfectly if you don't want to do it.
Do you know a third party library that support it ?
Is comparing JSON encoded values a valid alternative ?
Is the JSON encoding deterministic ? (fields order)
In the mean time I found a "fix" for my code:
I force the time's location with .In(time.UTC).
What version of Go are you using (
go version
)?go1.7.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
My code
What did you expect to see?
On my local computer (I live in France)
What did you see instead?
On Travis CI
The locations in the time are not equal.
Is it expected ?
Is it a bug ?
What should I do instead ? (I want my 2 structs to be equal with
reflect.DeepEqual()
)The text was updated successfully, but these errors were encountered: