From e554b8b4a0d8a0d016be4c1ce88527852f81c547 Mon Sep 17 00:00:00 2001 From: tj Date: Sat, 9 Oct 2010 15:09:59 +0200 Subject: [PATCH] More than one callback in example --- example/test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/example/test.go b/example/test.go index 7022235..b146d05 100644 --- a/example/test.go +++ b/example/test.go @@ -1,9 +1,10 @@ package main import ( - irc "github.com/thoj/Go-IRC-Client-Library" +// irc "github.com/thoj/Go-IRC-Client-Library" "fmt" "os" + "irc" ) func main() { @@ -14,6 +15,17 @@ func main() { fmt.Printf("%#v\n", irccon) os.Exit(1) } - irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo1") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo2") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo3") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo4") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo5") }) + irccon.AddCallback("001", func(e *irc.IRCEvent) { irccon.Join("#testgo6") }) + irccon.ReplaceCallback("001", 0, func(e *irc.IRCEvent) { irccon.Join("#testgo01") }) + irccon.ReplaceCallback("001", 1, func(e *irc.IRCEvent) { irccon.Join("#testgo02") }) + irccon.ReplaceCallback("001", 2, func(e *irc.IRCEvent) { irccon.Join("#testgo03") }) + irccon.ReplaceCallback("001", 3, func(e *irc.IRCEvent) { irccon.Join("#testgo04") }) + irccon.ReplaceCallback("001", 4, func(e *irc.IRCEvent) { irccon.Join("#testgo05") }) + irccon.ReplaceCallback("001", 6, func(e *irc.IRCEvent) { irccon.Join("#testgo06") }) irccon.Loop(); }