go-serial
go-serial copied to clipboard
Timeout : return an error compatible with os.IsTimeout()
Like *net.Conn.Read()
or *os.File.Read()
when a timeout occurs, return an error that can be checked with os.IsTimeout()
The actual behavior is "return 0 without error", that can also be understood as "end of stream". Network connections and file reads have their own timeout errors that can be detected with os.IsTimeout()
.
This is exactly the issue i'm running into. I'm using io.ReadFull
to fill a buffer directly from the port. However if a timeout is hit due to misconfiguration, it will loop forever.
Thanks for fixing this!