mirror of
https://github.com/elisescu/tty-share
synced 2024-11-11 13:10:32 +00:00
26 lines
343 B
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)
|
|
}
|