File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1818 ErrExist = errors .New ("file exists" )
1919)
2020
21+ // The following code is copied from the official implementation.
22+ // src/internal/poll/fd.go
23+
24+ // ErrDeadlineExceeded is returned for an expired deadline.
25+ // This is exported by the os package as os.ErrDeadlineExceeded.
26+ var ErrDeadlineExceeded error = & DeadlineExceededError {}
27+
28+ // DeadlineExceededError is returned for an expired deadline.
29+ type DeadlineExceededError struct {}
30+
31+ // Implement the net.Error interface.
32+ // The string is "i/o timeout" because that is what was returned
33+ // by earlier Go versions. Changing it may break programs that
34+ // match on error strings.
35+ func (e * DeadlineExceededError ) Error () string { return "i/o timeout" }
36+ func (e * DeadlineExceededError ) Timeout () bool { return true }
37+ func (e * DeadlineExceededError ) Temporary () bool { return true }
38+
2139// The following code is copied from the official implementation.
2240// https://github.com/golang/go/blob/4ce6a8e89668b87dce67e2f55802903d6eb9110a/src/os/error.go#L65-L104
2341
You can’t perform that action at this time.
0 commit comments