Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package winio
import (
"errors"
"io"
"os"
"runtime"
"sync"
"sync/atomic"
Expand All @@ -31,6 +32,10 @@ func (*timeoutError) Error() string { return "i/o timeout" }
func (*timeoutError) Timeout() bool { return true }
func (*timeoutError) Temporary() bool { return true }

// Unwrap returns os.ErrDeadlineExceeded so that errors.Is(err, os.ErrDeadlineExceeded)
// returns true for ErrTimeout, enabling interoperability with the standard library.
func (*timeoutError) Unwrap() error { return os.ErrDeadlineExceeded }

type timeoutChan chan struct{}

var ioInitOnce sync.Once
Expand Down