var ErrInvalid … var ErrPermission … var ErrExist … var ErrNotExist … var ErrClosed … var ErrNoDeadline … var ErrDeadlineExceeded … func errNoDeadline() error { … } // errDeadlineExceeded returns the value for os.ErrDeadlineExceeded. // This error comes from the internal/poll package, which is also // used by package net. Doing it this way ensures that the net // package will return os.ErrDeadlineExceeded for an exceeded deadline, // as documented by net.Conn.SetDeadline, without requiring any extra // work in the net package and without requiring the internal/poll // package to import os (which it can't, because that would be circular). func errDeadlineExceeded() error { … } type timeout … type PathError … type SyscallError … func (e *SyscallError) Error() string { … } func (e *SyscallError) Unwrap() error { … } // Timeout reports whether this error represents a timeout. func (e *SyscallError) Timeout() bool { … } // NewSyscallError returns, as an error, a new [SyscallError] // with the given system call name and error details. // As a convenience, if err is nil, NewSyscallError returns nil. func NewSyscallError(syscall string, err error) error { … } // IsExist returns a boolean indicating whether its argument is known to report // that a file or directory already exists. It is satisfied by [ErrExist] as // well as some syscall errors. // // This function predates [errors.Is]. It only supports errors returned by // the os package. New code should use errors.Is(err, fs.ErrExist). func IsExist(err error) bool { … } // IsNotExist returns a boolean indicating whether its argument is known to // report that a file or directory does not exist. It is satisfied by // [ErrNotExist] as well as some syscall errors. // // This function predates [errors.Is]. It only supports errors returned by // the os package. New code should use errors.Is(err, fs.ErrNotExist). func IsNotExist(err error) bool { … } // IsPermission returns a boolean indicating whether its argument is known to // report that permission is denied. It is satisfied by [ErrPermission] as well // as some syscall errors. // // This function predates [errors.Is]. It only supports errors returned by // the os package. New code should use errors.Is(err, fs.ErrPermission). func IsPermission(err error) bool { … } // IsTimeout returns a boolean indicating whether its argument is known // to report that a timeout occurred. // // This function predates [errors.Is], and the notion of whether an // error indicates a timeout can be ambiguous. For example, the Unix // error EWOULDBLOCK sometimes indicates a timeout and sometimes does not. // New code should use errors.Is with a value appropriate to the call // returning the error, such as [os.ErrDeadlineExceeded]. func IsTimeout(err error) bool { … } func underlyingErrorIs(err, target error) bool { … } // underlyingError returns the underlying error for known os error types. func underlyingError(err error) error { … }