package io import ( "io" "context" ) type wrappedIO struct { stdin io.Reader stdout io.Writer closer context.CancelFunc } func (wio *wrappedIO) Read(p []byte) (n int, err error) { return wio.stdin.Read(p) } func (wio *wrappedIO) Write(p []byte) (n int, err error) { return wio.stdout.Write(p) } func (wio *wrappedIO) Close() (err error) { wio.closer() return io.EOF }