From fcdba99a1a37e065139f7c699388a565bf7de3c8 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Wed, 19 Sep 2018 15:29:43 +0200 Subject: [PATCH] make APDUCommand serialize method public --- apdu/command.go | 2 +- apdu/command_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apdu/command.go b/apdu/command.go index 1d76f61..81398ec 100644 --- a/apdu/command.go +++ b/apdu/command.go @@ -24,7 +24,7 @@ func NewCommand(cla, ins, p1, p2 uint8, data []byte) *Command { } } -func (c *Command) serialize() ([]byte, error) { +func (c *Command) Serialize() ([]byte, error) { buf := new(bytes.Buffer) if err := binary.Write(buf, binary.BigEndian, c.Cla); err != nil { diff --git a/apdu/command_test.go b/apdu/command_test.go index 2fe13bc..6bfd5ef 100644 --- a/apdu/command_test.go +++ b/apdu/command_test.go @@ -37,7 +37,7 @@ func TestNewCommand(t *testing.T) { cmd := NewCommand(cla, ins, p1, p2, data) expected := "80 50 01 02 08 84 76 23 36 C5 18 7F E8 00" - result, err := cmd.serialize() + result, err := cmd.Serialize() assert.NoError(t, err) assert.Equal(t, expected, bytesToHexWithSpaces(result)) }