diff --git a/socketcan/socketcan.go b/socketcan/socketcan.go index f3973af..246e967 100644 --- a/socketcan/socketcan.go +++ b/socketcan/socketcan.go @@ -144,6 +144,8 @@ func (sck *CanSocket) Send(msg *can.Frame) error { idToWrite |= unix.CAN_RTR_FLAG case can.CanErrFrame: return errors.New("you can't send error frames") + case can.CanDataFrame: + default: return errors.New("unknown frame type") } diff --git a/socketcan/socketcan_test.go b/socketcan/socketcan_test.go index 94b1dea..df585ee 100644 --- a/socketcan/socketcan_test.go +++ b/socketcan/socketcan_test.go @@ -51,7 +51,7 @@ func TestCanSocket(t *testing.T) { err := sock.Send(testFrame) if err != nil { - t.Error(err) + t.Fatal(err) } })