aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 11:06:00 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 11:06:00 +0800
commit1e47f911f1facd709a868965c015b8a02917ad5b (patch)
tree8461ae644799339287a30f3a14742defed99190a
parentReadMessage should return the raw line too (diff)
downloadgo-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.tar.gz
go-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.tar.zst
go-lindenii-irc-1e47f911f1facd709a868965c015b8a02917ad5b.zip
Strip trailing \n tooHEADmaster
-rw-r--r--conn.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/conn.go b/conn.go
index 1cd8492..c84fc5d 100644
--- a/conn.go
+++ b/conn.go
@@ -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]
}