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

@ -6,7 +6,6 @@
package irc
import (
"errors"
"strings"
"golang.org/x/text/secure/precis"
@ -16,12 +15,6 @@ const (
casemappingName = "rfc8265"
)
var (
errCouldNotStabilize = errors.New("Could not stabilize string while casefolding")
errInvalidCharacter = errors.New("Invalid character")
errEmpty = errors.New("String is empty")
)
// Casefold returns a casefolded string, without doing any name or channel character checks.
func Casefold(str string) (string, error) {
var err error
@ -51,7 +44,7 @@ func CasefoldChannel(name string) (string, error) {
if err != nil {
return "", err
} else if len(lowered) == 0 {
return "", errEmpty
return "", errStringIsEmpty
}
if lowered[0] != '#' {
@ -76,7 +69,7 @@ func CasefoldName(name string) (string, error) {
if err != nil {
return "", err
} else if len(lowered) == 0 {
return "", errEmpty
return "", errStringIsEmpty
}
// space can't be used