2
0
mirror of https://github.com/elisescu/tty-share synced 2024-11-11 13:10:32 +00:00
tty-share/rw_combiner.go
2020-11-04 23:06:34 +01:00

26 lines
343 B
Go

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)
}