mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-14 19:58:11 -07:00
Move all errors into errors.go
This commit is contained in:
+2
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user