use the os.ErrDeadlineExceeded for stream deadline errors on Go 1.15

This commit is contained in:
Marten Seemann 2020-08-31 14:47:33 +07:00
parent 7c204d4d9e
commit fefdea3420
4 changed files with 41 additions and 9 deletions

View file

@ -0,0 +1,21 @@
// +build go1.15
package quic
import (
"errors"
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Deadline Error", func() {
It("is a net.Error that wraps os.ErrDeadlineError", func() {
err := deadlineError{}
Expect(err.Temporary()).To(BeTrue())
Expect(err.Timeout()).To(BeTrue())
Expect(errors.Is(err, os.ErrDeadlineExceeded)).To(BeTrue())
Expect(errors.Unwrap(err)).To(Equal(os.ErrDeadlineExceeded))
})
})