diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:06:00 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:06:00 +0800 |
commit | 1e47f911f1facd709a868965c015b8a02917ad5b (patch) | |
tree | 8461ae644799339287a30f3a14742defed99190a | |
parent | ReadMessage should return the raw line too (diff) | |
download | go-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.tar.gz go-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.tar.zst go-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.zip |
-rw-r--r-- | conn.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -24,6 +24,9 @@ func (c *Conn) ReadMessage() (msg Message, line string, err error) { return } + if raw[len(raw) - 1] == '\n' { + raw = raw[:len(raw) - 1] + } if raw[len(raw) - 1] == '\r' { raw = raw[:len(raw) - 1] } |