Skip to content

Commit

Permalink
chore(staticcheck): should use time.Until instead of t.Sub(time.Now()…
Browse files Browse the repository at this point in the history
…) (S1024)
  • Loading branch information
maitredede committed Aug 24, 2021
1 parent bcaab3f commit eb3bb81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serial_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (port *unixPort) Read(p []byte) (int, error) {
for {
timeout := time.Duration(-1)
if port.readTimeout != NoTimeout {
timeout = deadline.Sub(time.Now())
timeout = time.Until(deadline)
}
res, err := unixutils.Select(fds, nil, fds, timeout)
if err == unix.EINTR {
Expand Down

0 comments on commit eb3bb81

Please sign in to comment.