2
0
mirror of https://github.com/elisescu/tty-share synced 2024-11-15 18:13:58 +00:00
tty-share/rw_combiner.go

26 lines
343 B
Go
Raw Permalink Normal View History

package main
import (
"io"
)
type combiner struct {
r io.Reader
w io.Writer
}
func newReadWriter(r io.Reader, w io.Writer) io.ReadWriter {
return &combiner{
r: r,
w: w,
}
}
func (c *combiner) Read(p []byte) (n int, err error) {
return c.r.Read(p)
}
func (c *combiner) Write(p []byte) (n int, err error) {
return c.w.Write(p)
}