From 1e9692ec153f85a4a8232c9f5135a94a66fa0b42 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Mon, 31 Jul 2023 16:52:08 +0300 Subject: [PATCH] Update marshaling.go --- marshaling.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/marshaling.go b/marshaling.go index 6480672..f2584b9 100644 --- a/marshaling.go +++ b/marshaling.go @@ -60,25 +60,25 @@ func (l *StringMap) UnmarshalJSON(data []byte) error { func (l *CustomFieldMap) UnmarshalJSON(data []byte) error { var i interface{} - var m CustomFieldMap + var items CustomFieldMap if err := json.Unmarshal(data, &i); err != nil { return err } switch e := i.(type) { case map[string]interface{}: - m = make(CustomFieldMap, len(e)) + items = make(CustomFieldMap, len(e)) for idx, val := range e { - m[idx] = val + items[idx] = val } case []interface{}: - m = make(CustomFieldMap, len(e)) + items = make(CustomFieldMap, len(e)) for idx, val := range e { - m[strconv.Itoa(idx)] = val + items[strconv.Itoa(idx)] = val } } - *l = m + *l = items return nil }