Source File
error.go
Belonging Package
os
package os
import (
)
ErrInvalid = fs.ErrInvalid // "invalid argument"
ErrPermission = fs.ErrPermission // "permission denied"
ErrExist = fs.ErrExist // "file already exists"
ErrNotExist = fs.ErrNotExist // "file does not exist"
ErrClosed = fs.ErrClosed // "file already closed"
ErrNoDeadline = errNoDeadline() // "file type does not support deadline"
ErrDeadlineExceeded = errDeadlineExceeded() // "i/o timeout"
)
func () error { return oserror.ErrClosed }
func () error { return poll.ErrNoDeadline }
func () error { return poll.ErrDeadlineExceeded }
type timeout interface {
Timeout() bool
}
type SyscallError struct {
Syscall string
Err error
}
func ( *SyscallError) () string { return .Syscall + ": " + .Err.Error() }
func ( *SyscallError) () error { return .Err }
func ( *SyscallError) () bool {
, := .Err.(timeout)
return && .Timeout()
}
func ( error) bool {
return underlyingErrorIs(, ErrExist)
}
func ( error) bool {
return underlyingErrorIs(, ErrNotExist)
}
func ( error) bool {
return underlyingErrorIs(, ErrPermission)
}
func ( error) bool {
, := underlyingError().(timeout)
return && .Timeout()
}
= underlyingError()
if == {
return true
, := .(syscallErrorType)
return && .Is()
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |