aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conn.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/conn.go b/conn.go
index ac3787c..1cd8492 100644
--- a/conn.go
+++ b/conn.go
@@ -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
}