aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 10:51:56 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 10:51:56 +0800
commit19938778354b8d8672ea030450bd8e4609fafb48 (patch)
tree5ef8e16ed78c5e1842575eab14841098356c67c6
parentSend IRC message when receiving merge requests (diff)
downloadforge-19938778354b8d8672ea030450bd8e4609fafb48.tar.gz
forge-19938778354b8d8672ea030450bd8e4609fafb48.tar.zst
forge-19938778354b8d8672ea030450bd8e4609fafb48.zip
Handle error when doing NICK/USER
-rw-r--r--irc.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/irc.go b/irc.go
index 8fe22d1..be53815 100644
--- a/irc.go
+++ b/irc.go
@@ -32,10 +32,13 @@ func ircBotSession() error {
defer underlyingConn.Close()
conn := irc.NewConn(underlyingConn)
- conn.WriteString(
+ _, err = conn.WriteString(
"NICK " + config.IRC.Nick + "\r\n" +
"USER " + config.IRC.User + " 0 * :" + config.IRC.Gecos + "\r\n",
)
+ if err != nil {
+ return err
+ }
readLoopError := make(chan error)
writeLoopAbort := make(chan struct{})