1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 11:45:50 +03:00

Provide implementation hints for Windows

This commit is contained in:
Johan Walles 2024-07-14 12:25:17 +02:00
parent 45480cf702
commit 00bb910b6f

View File

@ -19,6 +19,11 @@ type interruptableReaderImpl struct {
shutdownRequested atomic.Bool
}
// NOTE: To work properly, this Read() should return immediately after somebody
// calls Interrupt(), *without first reading any bytes from the base reader*.
//
// This implementation doesn't do that. If you want to fix this, the not-Windows
// implementation in screen-setup.go may or may not work as inspiration.
func (r *interruptableReaderImpl) Read(p []byte) (n int, err error) {
if r.shutdownRequested.Load() {
err = io.EOF