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:
@@ -2,6 +2,7 @@ package self_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net"
|
||||
@@ -99,7 +100,8 @@ var _ = Describe("Stateless Resets", func() {
|
||||
_, serr = str.Read([]byte{0})
|
||||
}
|
||||
Expect(serr).To(HaveOccurred())
|
||||
Expect(serr).To(MatchError(&quic.StatelessResetError{}))
|
||||
statelessResetErr := &quic.StatelessResetError{}
|
||||
Expect(errors.As(serr, &statelessResetErr)).To(BeTrue())
|
||||
Expect(ln2.Close()).To(Succeed())
|
||||
Eventually(acceptStopped).Should(BeClosed())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user