tstest/natlab: use net.ErrClosed

We are now on 1.16.
And wgconn.NetErrClosed has been removed upstream.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
pull/1578/head
Josh Bleecher Snyder 4 years ago committed by Josh Bleecher Snyder
parent c99f260e40
commit d31eff8473

@ -26,7 +26,6 @@ import (
"sync" "sync"
"time" "time"
wgconn "github.com/tailscale/wireguard-go/conn"
"inet.af/netaddr" "inet.af/netaddr"
) )
@ -759,8 +758,7 @@ func (c *conn) canRead() error {
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()
if c.closed { if c.closed {
// TODO: when we switch to Go 1.16, replace this with net.ErrClosed return net.ErrClosed
return wgconn.NetErrClosed
} }
if !c.readDeadline.IsZero() && c.readDeadline.Before(time.Now()) { if !c.readDeadline.IsZero() && c.readDeadline.Before(time.Now()) {
return errors.New("read deadline exceeded") return errors.New("read deadline exceeded")

Loading…
Cancel
Save