forked from quic-go/quic-go
fix incorrect usage of errors.Is
errors.Is is supposed to used for equality of errors, not for type assertions. That's what errors.As is there for.
This commit is contained in:
@@ -300,7 +300,8 @@ func (c *client) dial(ctx context.Context) error {
|
||||
errorChan := make(chan error, 1)
|
||||
go func() {
|
||||
err := c.session.run() // returns as soon as the session is closed
|
||||
if !errors.Is(err, &errCloseForRecreating{}) && c.createdPacketConn {
|
||||
|
||||
if e := (&errCloseForRecreating{}); !errors.As(err, &e) && c.createdPacketConn {
|
||||
c.packetHandlers.Destroy()
|
||||
}
|
||||
errorChan <- err
|
||||
|
||||
Reference in New Issue
Block a user