Skip to content

Commit

Permalink
chore: use errors.Join of go1.20 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Sep 26, 2024
1 parent 082ac3b commit debb51b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions acceptor_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ func (eng *engine) listenStream(ln net.Listener) (err error) {
if atomic.LoadInt32(&eng.beingShutdown) == 0 {
eng.opts.Logger.Errorf("Accept() fails due to error: %v", err)
} else if errors.Is(err, net.ErrClosed) {
err = errorx.ErrEngineShutdown
// TODO: errors.Join() is not supported until Go 1.20,
// we will uncomment this line after we bump up the
// minimal supported go version to 1.20.
// err = errors.Join(err, errorx.ErrEngineShutdown)
err = errors.Join(err, errorx.ErrEngineShutdown)
}
return
}
Expand Down Expand Up @@ -81,9 +77,7 @@ func (eng *engine) ListenUDP(pc net.PacketConn) (err error) {
if atomic.LoadInt32(&eng.beingShutdown) == 0 {
eng.opts.Logger.Errorf("failed to receive data from UDP fd due to error:%v", err)
} else if errors.Is(err, net.ErrClosed) {
err = errorx.ErrEngineShutdown
// TODO: ditto.
// err = errors.Join(err, errorx.ErrEngineShutdown)
err = errors.Join(err, errorx.ErrEngineShutdown)
}
return
}
Expand Down

0 comments on commit debb51b

Please sign in to comment.