From 9759c4f267ab1af0fe698f7f625c70d5078d2c5f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 14:08:00 +0800 Subject: commandHandlers -> CommandHandlers --- cmd.go | 2 +- cmd_cap.go | 2 +- cmd_nick.go | 2 +- cmd_ping.go | 2 +- cmd_user.go | 2 +- main.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd.go b/cmd.go index badd5b7..a7f2ff5 100644 --- a/cmd.go +++ b/cmd.go @@ -1,5 +1,5 @@ package main -var commandHandlers = map[string](func(RMsg, *Client) error){} +var CommandHandlers = map[string](func(RMsg, *Client) error){} /* Maybe we should make command handlers return their values for easier labelled-reply? */ diff --git a/cmd_cap.go b/cmd_cap.go index c1ddb1d..a2af228 100644 --- a/cmd_cap.go +++ b/cmd_cap.go @@ -5,7 +5,7 @@ import ( ) func init() { - commandHandlers["CAP"] = handleClientCap + CommandHandlers["CAP"] = handleClientCap } func handleClientCap(msg RMsg, client *Client) error { diff --git a/cmd_nick.go b/cmd_nick.go index f24a7fd..4c84a37 100644 --- a/cmd_nick.go +++ b/cmd_nick.go @@ -6,7 +6,7 @@ import ( ) func init() { - commandHandlers["NICK"] = handleClientNick + CommandHandlers["NICK"] = handleClientNick } func handleClientNick(msg RMsg, client *Client) error { diff --git a/cmd_ping.go b/cmd_ping.go index 9da4ee9..951233e 100644 --- a/cmd_ping.go +++ b/cmd_ping.go @@ -1,7 +1,7 @@ package main func init() { - commandHandlers["PING"] = handleClientPing + CommandHandlers["PING"] = handleClientPing } func handleClientPing(msg RMsg, client *Client) error { diff --git a/cmd_user.go b/cmd_user.go index bf8df64..93ee17e 100644 --- a/cmd_user.go +++ b/cmd_user.go @@ -5,7 +5,7 @@ import ( ) func init() { - commandHandlers["USER"] = handleClientUser + CommandHandlers["USER"] = handleClientUser } func handleClientUser(msg RMsg, client *Client) error { diff --git a/main.go b/main.go index edb629a..28b05b0 100644 --- a/main.go +++ b/main.go @@ -91,7 +91,7 @@ messageLoop: } } - handler, ok := commandHandlers[msg.Command] + handler, ok := CommandHandlers[msg.Command] if !ok { err := client.Send(MakeMsg(self, ERR_UNKNOWNCOMMAND, msg.Command, "Unknown command")) if err != nil { -- cgit v1.2.3