#protip: Use time.Time's Equal method to compare for equality.
Read https://golang.org/pkg/time/#Time for what == means for time.Time.
#golang
The problem I've run into is when a `time.Time` is part of another type that you want to compare for equality.
-
-
Yup. This just came up in the Gophers Slack. Someone was saying that 1.9 broken tests. Struct equality with embedded time.Time. Thus, tweet.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Using https://github.com/google/go-cmp as a replacement for reflect.DeepEqual helps because go-cmp prefers Equal methods over == when available.
-
I thought the comment about avoiding time.Time as map keys was interesting, especially since a quick grep shows that's fairly common.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.