From 6788aa81f81a38d016d7836093ce4a55baf1d900 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Tue, 14 Feb 2017 07:37:04 -0500 Subject: [PATCH] update documentation --- state.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/state.go b/state.go index 41633f0..d684af0 100644 --- a/state.go +++ b/state.go @@ -178,7 +178,7 @@ func (c *Channel) NickList() []string { out := make([]string, len(c.users)) var index int - for k, _ := range c.users { + for k := range c.users { out[index] = k index++ @@ -192,16 +192,18 @@ func (c *Channel) Len() int { return len(c.users) } -func (c *Channel) Lookup(nick string) (user *User, ok bool) { +// Lookup looks up a user in a channel based on a given nickname. If the +// user wasn't found, user is nil. +func (c *Channel) Lookup(nick string) (user *User) { for k, v := range c.users { if strings.ToLower(k) == strings.ToLower(nick) { // No need to have a copy, as if one has access to a channel, // should already have a full copy. - return v, true + return v } } - return nil, false + return nil } // Message returns an event which can be used to send a response to the channel.