From eacc75566e17447a0524817dc6e1c115467d1bb9 Mon Sep 17 00:00:00 2001 From: Martin Hebnes Pedersen Date: Mon, 15 Apr 2019 21:38:41 +0200 Subject: [PATCH] Fix test breaking due to vet checks Some incorrect fmt formatting strings broke tests due to vet checks being automatically applied since Go 1.10. --- controlblock.go | 2 +- dataheader.go | 2 +- dataheader_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controlblock.go b/controlblock.go index ad36a98..4dfe3fd 100644 --- a/controlblock.go +++ b/controlblock.go @@ -284,7 +284,7 @@ func ParseControlBlock(data []byte) (*ControlBlock, error) { cb.Data = &Preamble{} break default: - return nil, fmt.Errorf("dmr: unknown CSBK opcode %#02x (%#06b)", cb.Opcode, cb.Opcode) + return nil, fmt.Errorf("dmr: unknown CSBK opcode %02x (%06b)", cb.Opcode, cb.Opcode) } if err := cb.Data.Parse(data); err != nil { diff --git a/dataheader.go b/dataheader.go index b990f17..f0e0c5e 100644 --- a/dataheader.go +++ b/dataheader.go @@ -350,7 +350,7 @@ type ResponseData struct { } func (d ResponseData) String() string { - return fmt.Sprintf("response, blocks %d, type %s (%#02b %#03b), status %d", + return fmt.Sprintf("response, blocks %d, type %s (%02b %03b), status %d", d.BlocksToFollow, ResponseTypeName[d.ClassType], (d.ClassType >> 3), (d.ClassType & 0x07), d.Status) } diff --git a/dataheader_test.go b/dataheader_test.go index 19562a0..4e780f8 100644 --- a/dataheader_test.go +++ b/dataheader_test.go @@ -211,7 +211,7 @@ func TestDataHeaderShortDataDefined(t *testing.T) { t.Fatalf("decode failed: appended blocks wrong") case d.DDFormat != DDFormatUTF16: - t.Fatalf("decode failed: dd format wrong, expected UTF-16, got %d", DDFormatName[d.DDFormat]) + t.Fatalf("decode failed: dd format wrong, expected UTF-16, got %s", DDFormatName[d.DDFormat]) case d.Resync: t.Fatalf("decode failed: rsync bit wrong")