From 14ecbbf7f205b918038410e67e8167d5735f04bc Mon Sep 17 00:00:00 2001 From: Pavel Gabriel Date: Mon, 14 Feb 2022 15:10:24 +0100 Subject: [PATCH] format some code --- message.go | 8 ++++---- message_test.go | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/message.go b/message.go index 1203a9ba..5f07bbba 100644 --- a/message.go +++ b/message.go @@ -208,14 +208,14 @@ func (m *Message) MarshalJSON() ([]byte, error) { fieldMap := m.GetFields() strFieldMap := map[string]field.Field{} - for k, v := range fieldMap { + for id, field := range fieldMap { // we don't wish to populate the bitmap in the final // JSON since it is dynamically generated when packing // and unpacking anyways. - if k == bitmapIdx { + if id == bitmapIdx { continue } - strFieldMap[fmt.Sprint(k)] = v + strFieldMap[fmt.Sprint(id)] = field } // get only fields that were set @@ -253,7 +253,7 @@ func (m *Message) packableFieldIDs() ([]int, error) { // Index 1 represent bitmap which is always populated. populatedFieldIDs := []int{1} - for id, _ := range m.fieldsMap { + for id := range m.fieldsMap { // represents the bitmap if id == 1 { continue diff --git a/message_test.go b/message_test.go index 450a97bb..c2d6f704 100644 --- a/message_test.go +++ b/message_test.go @@ -122,7 +122,6 @@ func TestMessage(t *testing.T) { } message := NewMessage(spec) - message.SetData(&ISO87Data{}) rawMsg := []byte("01007000000000000000164242424242424242123456000000000100") err := message.Unpack([]byte(rawMsg))