-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing/iotest: ErrTimeout fails os.IsTimeout #37263
Comments
This result is consistent since the day that @ianlancetaylor introduces The question is whether the Go team will recognize this as expected behavior with more documentation or a bug that should be fixed. |
I think that Making it match is just switching type errTimeout struct{}
func (errTimeout) Error() string {
return "timeout"
}
func (errTimeout) Timeout() bool {
return true
}
var ErrTimeout error = errTimeout{} I can provide this as a PR (with added documentation). |
Also /cc-ing @mpvl @josharian as owners of testing Just for some context, |
os.IsTimeout does what it does and won't be changing. The comments need to be updated to mark it as deprecated - use errors.Is instead. Fixing the doc comments is #41122 . |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
https://play.golang.org/p/T4bwPszSzM0
What did you do?
What did you expect to see?
true
What did you see instead?
false
The text was updated successfully, but these errors were encountered: