diff options
-rw-r--r-- | conn.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -18,7 +18,7 @@ func NewConn(netConn net.Conn) Conn { } } -func (c *Conn) ReadMessage() (msg Message, err error) { +func (c *Conn) ReadMessage() (msg Message, line string, err error) { raw, err := c.bufReader.ReadSlice('\n') if err != nil { return @@ -28,7 +28,9 @@ func (c *Conn) ReadMessage() (msg Message, err error) { raw = raw[:len(raw) - 1] } - msg, err = Parse(slices.Clone(raw)) + lineBytes := slices.Clone(raw) + line = bytesToString(lineBytes) + msg, err = Parse(lineBytes) return } |