You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tty-share/rw_combiner.go

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