Add String() method for stateTracker.

This commit is contained in:
Alex Bramley 2011-11-05 06:06:59 +00:00
parent fdba74e8c0
commit b1037b2603
1 changed files with 16 additions and 0 deletions

View File

@ -246,3 +246,19 @@ func (st *stateTracker) Dissociate(ch *Channel, nk *Nick) {
}
}
}
func (st *stateTracker) String() string {
str := "GoIRC Channels\n"
str += "--------------\n\n"
for _, ch := range st.chans {
str += ch.String() + "\n"
}
str += "GoIRC NickNames\n"
str += "---------------\n\n"
for _, n := range st.nicks {
if n != st.me {
str += n.String() + "\n"
}
}
return str
}