Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 96d4995

Browse files
committed
Minor change in mapping pkg.
1 parent b033fc4 commit 96d4995

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mapping/map.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ func (m *ModelMap) RegisterModels(models ...interface{}) error {
173173

174174
for _, model := range m.models {
175175
model.structFieldCount = len(model.StructFields())
176+
model.clearInitializeStoreKeys()
176177
}
178+
177179
return nil
178180
}
179181

mapping/values_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ func TestValues(t *testing.T) {
8686

8787
assert.Equal(t, uint(65), v)
8888

89-
v, err = attr.ValueFromString("-12")
90-
require.Error(t, err)
89+
_, err = attr.ValueFromString("-12")
90+
assert.Error(t, err)
9191

9292
attr, ok = mStruct.Field("Time")
9393
require.True(t, ok)
9494

9595
tm := time.Now()
9696

97-
v, err = attr.ValueFromString(strconv.FormatInt(tm.UnixNano(), 10))
97+
_, err = attr.ValueFromString(strconv.FormatInt(tm.UnixNano(), 10))
9898
assert.Error(t, err)
9999

100100
attr, ok = mStruct.Field("Flt")
@@ -105,7 +105,7 @@ func TestValues(t *testing.T) {
105105
assert.InDelta(t, -12.321, v, 0.001)
106106
}
107107

108-
v, err = attr.ValueFromString("invalid")
108+
_, err = attr.ValueFromString("invalid")
109109
assert.Error(t, err)
110110

111111
attr, ok = mStruct.Field("Bl")

0 commit comments

Comments
 (0)