MM-27456: Use reflect-free serialization for hot structs (#15171)

Automatic Merge
Этот коммит содержится в:
Agniva De Sarker
2020-08-13 13:05:57 +05:30
коммит произвёл GitHub
родитель 32b7d2b5f1
Коммит 91a76b2df9
34 изменённых файлов: 6224 добавлений и 6 удалений

Просмотреть файл

@@ -101,6 +101,8 @@ func TestUserStoreCache(t *testing.T) {
cachedUsers, err = cachedStore.User().GetProfileByIds(fakeUserIds, &store.UserGetByIdsOpts{}, true)
require.Nil(t, err)
for i := 0; i < len(storedUsers); i++ {
storedUsers[i].Props = model.StringMap{}
storedUsers[i].Timezone = model.StringMap{}
assert.Equal(t, storedUsers[i], cachedUsers[i])
if storedUsers[i] == cachedUsers[i] {
assert.Fail(t, "should be different pointers")
@@ -241,6 +243,8 @@ func TestUserStoreGetCache(t *testing.T) {
cachedUser.NotifyProps["key"] = "othervalue"
assert.NotEqual(t, storedUser, cachedUser)
storedUser.Props = model.StringMap{}
storedUser.Timezone = model.StringMap{}
cachedUser, err = cachedStore.User().Get(fakeUserId)
require.Nil(t, err)
assert.Equal(t, storedUser, cachedUser)