fix socketcan bugs
All checks were successful
Go / build (1.21) (push) Successful in 1m7s
Go / build (1.22) (push) Successful in 1m5s

This commit is contained in:
saji 2024-03-07 15:06:16 -06:00
parent 641c35afbd
commit cf112ef561
2 changed files with 3 additions and 1 deletions

View file

@ -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")
}

View file

@ -51,7 +51,7 @@ func TestCanSocket(t *testing.T) {
err := sock.Send(testFrame)
if err != nil {
t.Error(err)
t.Fatal(err)
}
})