mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-21 04:49:04 +00:00
os: add IsTimeout function
Fixes build error: undefined: os.IsTimeout Signed-off-by: Christian Stewart <christian@paral.in>
This commit is contained in:
committed by
Ron Evans
parent
57ecf1acdc
commit
930255ff46
@@ -92,6 +92,11 @@ func IsPermission(err error) bool {
|
|||||||
return underlyingErrorIs(err, ErrPermission)
|
return underlyingErrorIs(err, ErrPermission)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsTimeout(err error) bool {
|
||||||
|
terr, ok := underlyingError(err).(timeout)
|
||||||
|
return ok && terr.Timeout()
|
||||||
|
}
|
||||||
|
|
||||||
func underlyingErrorIs(err, target error) bool {
|
func underlyingErrorIs(err, target error) bool {
|
||||||
// Note that this function is not errors.Is:
|
// Note that this function is not errors.Is:
|
||||||
// underlyingError only unwraps the specific error-wrapping types
|
// underlyingError only unwraps the specific error-wrapping types
|
||||||
|
|||||||
Reference in New Issue
Block a user