Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tinygo-org/tinygo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: release
Choose a base ref
...
head repository: rvolosatovs/tinygo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feat/syscall-timeout
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Aug 5, 2022

  1. os: add SyscallError.Timeout

    Signed-off-by: Roman Volosatovs <[email protected]>
    rvolosatovs committed Aug 5, 2022
    Copy the full SHA
    2738b2a View commit details
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/os/errors.go
10 changes: 10 additions & 0 deletions src/os/errors.go
Original file line number Diff line number Diff line change
@@ -70,6 +70,16 @@ func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err.Error()

func (e *SyscallError) Unwrap() error { return e.Err }

type timeout interface {
Timeout() bool
}

// Timeout reports whether this error represents a timeout.
func (e *SyscallError) Timeout() bool {
t, ok := e.Err.(timeout)
return ok && t.Timeout()
}

func IsExist(err error) bool {
return underlyingErrorIs(err, ErrExist)
}