)
type Client struct {
- hostname string
+ hostname *string
conn net.Conn
registered bool
nickname string
return client.nickname + "!" + client.username + "@" + client.conn.RemoteAddr().String()
}
-func NewClient(hostname string, conn net.Conn) *Client {
+func NewClient(hostname *string, conn net.Conn) *Client {
return &Client{hostname: hostname, conn: conn, nickname: "*", password: ""}
}
// Send message from server. It has ": servername" prefix.
func (client *Client) Reply(text string) {
- client.Msg(":" + client.hostname + " " + text)
+ client.Msg(":" + *client.hostname + " " + text)
}
// Send server message, concatenating all provided text parts and