use net.ErrClosed (for Go 1.16)

This commit is contained in:
Marten Seemann
2021-04-26 19:22:19 +07:00
parent b8f07c728c
commit b38498273b
5 changed files with 110 additions and 28 deletions

View File

@@ -0,0 +1,22 @@
// +build go1.16
package qerr
import (
"errors"
"net"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("QUIC Errors", func() {
It("says that errors are net.ErrClosed errors", func() {
Expect(errors.Is(&TransportError{}, net.ErrClosed)).To(BeTrue())
Expect(errors.Is(&ApplicationError{}, net.ErrClosed)).To(BeTrue())
Expect(errors.Is(&IdleTimeoutError{}, net.ErrClosed)).To(BeTrue())
Expect(errors.Is(&HandshakeTimeoutError{}, net.ErrClosed)).To(BeTrue())
Expect(errors.Is(&StatelessResetError{}, net.ErrClosed)).To(BeTrue())
Expect(errors.Is(&VersionNegotiationError{}, net.ErrClosed)).To(BeTrue())
})
})