uquic/internal/qerr/errors_go116.go
Marten Seemann dbb517858e 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.
2021-06-28 15:29:52 -07:00

14 lines
597 B
Go

// +build go1.16
package qerr
import (
"net"
)
func (e *TransportError) Is(target error) bool { return target == net.ErrClosed }
func (e *ApplicationError) Is(target error) bool { return target == net.ErrClosed }
func (e *IdleTimeoutError) Is(target error) bool { return target == net.ErrClosed }
func (e *HandshakeTimeoutError) Is(target error) bool { return target == net.ErrClosed }
func (e *VersionNegotiationError) Is(target error) bool { return target == net.ErrClosed }
func (e *StatelessResetError) Is(target error) bool { return target == net.ErrClosed }