Igor Sirotin 679391999f
feat_: LogOnPanic linter (#5969)
* feat_: LogOnPanic linter

* fix_: add missing defer LogOnPanic

* chore_: make vendor

* fix_: tests, address pr comments

* fix_: address pr comments
2024-10-23 21:33:05 +01:00

30 lines
562 B
Go

package gopls
import "io"
// IOStream combines stdin and stdout into one interface.
type IOStream struct {
stdin io.WriteCloser
stdout io.ReadCloser
}
// Write writes data to stdin.
func (c *IOStream) Write(p []byte) (n int, err error) {
return c.stdin.Write(p)
}
// Read reads data from stdout.
func (c *IOStream) Read(p []byte) (n int, err error) {
return c.stdout.Read(p)
}
// Close closes both stdin and stdout.
func (c *IOStream) Close() error {
err1 := c.stdin.Close()
err2 := c.stdout.Close()
if err1 != nil {
return err1
}
return err2
}