From 6a8c1a13b27e5b185cf41b4d51c63512834c7251 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Thu, 17 Dec 2009 21:14:01 +0000 Subject: [PATCH] correct syntax errors from updating go to 4450:dd9bae5c7eac --- client.go | 6 +++--- irc/connection.go | 2 +- irc/handlers.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client.go b/client.go index 9b225b6..a88399c 100644 --- a/client.go +++ b/client.go @@ -13,12 +13,12 @@ func main() { c := irc.New("GoTest", "gotest", "GoBot"); c.AddHandler("connected", func(conn *irc.Conn, line *irc.Line) { - conn.Join("#"); + conn.Join("#go-lang"); } ); // connect to server - if err := c.Connect("irc.pl0rt.org", ""); err != nil { + if err := c.Connect("irc.freenode.net", ""); err != nil { fmt.Printf("Connection error: %s\n", err); return; } @@ -77,7 +77,7 @@ func main() { // if we don't really want to quit, reconnect! if !reallyquit { fmt.Println("Reconnecting..."); - if err := c.Connect("irc.pl0rt.org", ""); err != nil { + if err := c.Connect("irc.freenode.net", ""); err != nil { fmt.Printf("Connection error: %s\n", err); break; } diff --git a/irc/connection.go b/irc/connection.go index 667bea6..c5305a5 100644 --- a/irc/connection.go +++ b/irc/connection.go @@ -83,7 +83,7 @@ func (conn *Conn) Connect(host, pass string) os.Error { conn.io = bufio.NewReadWriter( bufio.NewReader(conn.sock), - bufio.NewWriter(conn.sock) + bufio.NewWriter(conn.sock), ); go conn.send(); go conn.recv(); diff --git a/irc/handlers.go b/irc/handlers.go index 8225c07..77aac0d 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -41,8 +41,8 @@ func (conn *Conn) dispatchEvent(line *Line) { // So, I think CTCP and (in particular) CTCP ACTION are better handled as // separate events as opposed to forcing people to have gargantuan PRIVMSG // handlers to cope with the possibilities. - if line.Cmd == "PRIVMSG" && len(line.Text) > 2 - && line.Text[0] == '\001' && line.Text[len(line.Text)-1] == '\001' { + if line.Cmd == "PRIVMSG" && len(line.Text) > 2 && + line.Text[0] == '\001' && line.Text[len(line.Text)-1] == '\001' { // WOO, it's a CTCP message t := strings.Split(line.Text[1:len(line.Text)-1], " ", 2); if c := strings.ToUpper(t[0]); c == "ACTION" {