From eef65b116e2ff6483169b218552aaad8f85cedbd Mon Sep 17 00:00:00 2001 From: tpltnt Date: Fri, 14 Feb 2014 15:40:25 +0100 Subject: [PATCH] some doc on structs --- irc_callback.go | 1 + irc_struct.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/irc_callback.go b/irc_callback.go index cee0e54..58ecbd7 100644 --- a/irc_callback.go +++ b/irc_callback.go @@ -10,6 +10,7 @@ import ( "time" ) + func (irc *Connection) AddCallback(eventcode string, callback func(*Event)) string { eventcode = strings.ToUpper(eventcode) diff --git a/irc_struct.go b/irc_struct.go index 57a4443..de05e83 100644 --- a/irc_struct.go +++ b/irc_struct.go @@ -43,6 +43,8 @@ type Connection struct { stopped bool } + +// A struct to represent an event. type Event struct { Code string Raw string @@ -53,7 +55,8 @@ type Event struct { Arguments []string } -// Convenience func to get the last arg, now that the Message field is gone + +// Extract the last message from an Event. This function eventually returns an empty string. func (e *Event) Message() string { if len(e.Arguments) == 0 { return ""