From 85e3dd9834de7fc276bd26eb3c4ef82e6306a647 Mon Sep 17 00:00:00 2001 From: imsk17 Date: Sat, 12 Oct 2024 23:39:46 +0530 Subject: [PATCH] chore(lint): fix lint issues --- cbor_test.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cbor_test.go b/cbor_test.go index 0f06e46..193203e 100644 --- a/cbor_test.go +++ b/cbor_test.go @@ -22,19 +22,22 @@ func Test_DefaultCBOREncoder(t *testing.T) { raw, err := cborEncoder(ss) require.NoError(t, err) - require.Equal(t, hex.EncodeToString([]byte(raw)), importantString) + require.Equal(t, hex.EncodeToString(raw), importantString) } func Test_DefaultCBORDecoder(t *testing.T) { t.Parallel() var ( - ss sampleStructure - importantString, _ = hex.DecodeString("a170696d706f7274616e745f737472696e676b48656c6c6f20576f726c64") - cborDecoder CBORUnmarshal = cbor.Unmarshal + ss sampleStructure + importantString, err = hex.DecodeString("a170696d706f7274616e745f737472696e676b48656c6c6f20576f726c64") + cborDecoder CBORUnmarshal = cbor.Unmarshal ) + if err != nil { + t.Error("Failed to decode hex string") + } - err := cborDecoder(importantString, &ss) + err = cborDecoder(importantString, &ss) require.NoError(t, err) require.Equal(t, "Hello World", ss.ImportantString) }