mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
* refactor: Maintain single code path for package manager execution * fix: Avoid context leak during interactive TTY read * fix: PTY flow handling * fix: Linter fixes
18 lines
230 B
Go
18 lines
230 B
Go
//go:build windows
|
|
|
|
package pty
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
)
|
|
|
|
func readInput(ctx context.Context, src io.Reader, buf []byte) (int, error) {
|
|
select {
|
|
case <-ctx.Done():
|
|
return 0, ctx.Err()
|
|
default:
|
|
return src.Read(buf)
|
|
}
|
|
}
|