Fixed misuses of fmt.Println and t.Error

This commit is contained in:
NI
2022-04-15 18:14:31 +08:00
parent f332365334
commit 5d3eee1b52
2 changed files with 3 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ func (h *handlerSender) signal(hd Header, d []byte, buf []byte) error {
dLen := len(d) dLen := len(d)
if bufLen < dLen+1 { if bufLen < dLen+1 {
panic(fmt.Sprintln("Sending signal %s:%d requires %d bytes of buffer, "+ panic(fmt.Sprintf("Sending signal %s:%d requires %d bytes of buffer, "+
"but only %d bytes is available", hd, d, dLen+1, bufLen)) "but only %d bytes is available", hd, d, dLen+1, bufLen))
} }

View File

@@ -65,7 +65,7 @@ func TestIntegerSingleByte1(t *testing.T) {
} }
if mLen != 1 { if mLen != 1 {
t.Error("Expecting the Integer to be marshalled into %d bytes, got "+ t.Errorf("Expecting the Integer to be marshalled into %d bytes, got "+
"%d instead", 1, mLen) "%d instead", 1, mLen)
return return
@@ -101,7 +101,7 @@ func TestIntegerSingleByte2(t *testing.T) {
} }
if mLen != 1 { if mLen != 1 {
t.Error("Expecting the Integer to be marshalled into %d bytes, got "+ t.Errorf("Expecting the Integer to be marshalled into %d bytes, got "+
"%d instead", 1, mLen) "%d instead", 1, mLen)
return return