Signed-off-by: Roman Volosatovs <roman@profian.com>
Этот коммит содержится в:
Roman Volosatovs 2022-07-08 17:24:42 +02:00 коммит произвёл Ron Evans
родитель 9e7667ffae
коммит 9d73e6cfe4

Просмотреть файл

@ -70,6 +70,16 @@ func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err.Error()
func (e *SyscallError) Unwrap() error { return e.Err }
type timeout interface {
Timeout() bool
}
// Timeout reports whether this error represents a timeout.
func (e *SyscallError) Timeout() bool {
t, ok := e.Err.(timeout)
return ok && t.Timeout()
}
func IsExist(err error) bool {
return underlyingErrorIs(err, ErrExist)
}