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
4 changes: 2 additions & 2 deletions cancelreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type File interface {
}

// fallbackCancelReader implements cancelReader but does not actually support
// cancelation during an ongoing Read() call. Thus, Cancel() always returns
// cancellation during an ongoing Read() call. Thus, Cancel() always returns
// false. However, after calling Cancel(), new Read() calls immediately return
// errCanceled and don't consume any data anymore.
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment refers to errCanceled, but the exported sentinel error is ErrCanceled (capital E). Updating the comment to match the actual identifier avoids confusion for readers searching the code.

Suggested change
// errCanceled and don't consume any data anymore.
// ErrCanceled and don't consume any data anymore.

Copilot uses AI. Check for mistakes.
type fallbackCancelReader struct {
Expand Down Expand Up @@ -72,7 +72,7 @@ func (r *fallbackCancelReader) Close() error {
return nil
}

// cancelMixin represents a goroutine-safe cancelation status.
// cancelMixin represents a goroutine-safe cancellation status.
type cancelMixin struct {
unsafeCanceled bool
lock sync.Mutex
Expand Down
Loading