mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Move all errors into errors.go
This commit is contained in:
parent
3ef4c5f799
commit
2419f69879
17 changed files with 100 additions and 100 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue