Skip to content

Commit ead17c9

Browse files
Fix wrong type (its a pointer type)
return error if unmarshalling fails
1 parent 3ffdf77 commit ead17c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

concurrent_map.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ func fnv32(key string) uint32 {
325325
}
326326

327327
// Reverse process of Marshal.
328-
func (m ConcurrentMap[V]) UnmarshalJSON(b []byte) (err error) {
328+
func (m *ConcurrentMap[V]) UnmarshalJSON(b []byte) (err error) {
329329
tmp := make(map[string]V)
330330

331331
// Unmarshal into a single map.
332332
if err := json.Unmarshal(b, &tmp); err != nil {
333-
return nil
333+
return err
334334
}
335335

336336
// foreach key,value pair in temporary map insert into our concurrent map.

0 commit comments

Comments
 (0)