From 5c347008fb8f24426196fcb995a0d1e9236f35ca Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Mon, 22 Aug 2011 17:16:32 +0100 Subject: [PATCH] Update README.md with external Connected var. --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9c1e5f1..d318f9c 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,9 @@ Synopsis: c.SSL = true // Add handlers to do things here! - // e.g. watching for disconnection from the server. - connected := true - c.AddHandler("disconnected", - func(conn *irc.Conn, line *irc.Line) { connected = false }) + // e.g. join a channel on connect. + c.AddHandler("connected", + func(conn *irc.Conn, line *irc.Line) { conn.Join("#channel") }) // Tell client to connect if err := c.Connect("irc.freenode.net"); err != nil { @@ -38,7 +37,7 @@ Synopsis: } // Loop until client gets disconnected, printing any errors - for connected { + for c.Connected { if err := <-c.Err; err != nil { fmt.Printf("goirc error: %s", err.String()) }