-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
When using assert.Equal(t, x, y) and assert.EqualValues(t, x, y), I run into the following issue where it errors but no diff is displayed. After digging down I discovered it's to do with time.Time and whether *time.Location is initialised.
Output from assert:
Error Trace: store_test.go:70
Error: Not equal:
expected: []*cache.Item{(*cache.Item)(0xc4201a2640), (*cache.Item)(0xc4201a2780)}
received: []*cache.Item{(*cache.Item)(0xc42021e000), (*cache.Item)(0xc42021e140)}
Diff:
Logging out the structs with "%#v" reveals the difference is in time.Time. See my manual diff below:
- ExpiresAt:time.Time{sec:0, nsec:0, loc:(*time.Location)(nil)},
+ ExpiresAt:time.Time{sec:0, nsec:0, loc:(*time.Location)(0x8bb580)},
Reactions are currently unavailable