From 85ee4c48f5ac206bdfe5472a2c721dae69251d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Nowotnik?= Date: Fri, 8 Jul 2022 18:27:25 +0200 Subject: [PATCH] doc fixes --- stream.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stream.go b/stream.go index e3f617b..75cf3f2 100644 --- a/stream.go +++ b/stream.go @@ -169,8 +169,9 @@ func (VSCodeObjectCodec) ReadObject(stream *bufio.Reader, v interface{}) error { return json.NewDecoder(io.LimitReader(stream, int64(contentLength))).Decode(v) } -// DEPRECATED: use NewPlainObjectStream // PlainObjectCodec reads/writes plain JSON-RPC 2.0 objects without a header. +// +// Deprecated: use NewPlainObjectStream type PlainObjectCodec struct { decoder *json.Decoder encoder *json.Encoder @@ -192,6 +193,7 @@ func (c PlainObjectCodec) ReadObject(stream *bufio.Reader, v interface{}) error return json.NewDecoder(stream).Decode(v) } +// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header. type plainObjectStream struct { conn io.Closer decoder *json.Decoder @@ -199,7 +201,6 @@ type plainObjectStream struct { mu sync.Mutex } -// plainObjectStream reads/writes plain JSON-RPC 2.0 objects without a header. func NewPlainObjectStream(conn io.ReadWriteCloser) ObjectStream { os := &plainObjectStream{conn: conn} os.encoder = json.NewEncoder(conn)