Skip to content

Commit

Permalink
Fix test breaking due to vet checks
Browse files Browse the repository at this point in the history
Some incorrect fmt formatting strings broke tests due to vet checks
being automatically applied since Go 1.10.
  • Loading branch information
martinhpedersen committed Apr 15, 2019
1 parent d782d04 commit eacc755
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controlblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion dataheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion dataheader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit eacc755

Please sign in to comment.