1
0
Fork 0
forked from External/ergo

Move all errors into errors.go

This commit is contained in:
Daniel Oaks 2018-02-03 22:03:36 +10:00
parent 3ef4c5f799
commit 2419f69879
17 changed files with 100 additions and 100 deletions

View file

@ -5,7 +5,6 @@
package irc
import (
"errors"
"fmt"
"log"
"regexp"
@ -17,11 +16,6 @@ import (
"sync"
)
var (
ErrNickMissing = errors.New("nick missing")
ErrNicknameInUse = errors.New("nickname in use")
)
// ExpandUserHost takes a userhost, and returns an expanded version.
func ExpandUserHost(userhost string) (expanded string) {
expanded = userhost
@ -91,7 +85,7 @@ func (clients *ClientManager) Remove(client *Client) error {
defer clients.Unlock()
if !client.HasNick() {
return ErrNickMissing
return errNickMissing
}
clients.removeInternal(client)
return nil
@ -111,7 +105,7 @@ func (clients *ClientManager) SetNick(client *Client, newNick string) error {
currentNewEntry := clients.byNick[newcfnick]
// the client may just be changing case
if currentNewEntry != nil && currentNewEntry != client {
return ErrNicknameInUse
return errNicknameInUse
}
clients.byNick[newcfnick] = client
client.updateNickMask(newNick)