aboutsummaryrefslogtreecommitdiff
path: root/go/game/set.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/set.go')
-rw-r--r--go/game/set.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/go/game/set.go b/go/game/set.go
index fe25e3a1..c4733423 100644
--- a/go/game/set.go
+++ b/go/game/set.go
@@ -2,7 +2,6 @@ package game
import (
"errors"
- "fmt"
"log"
"net/http"
"path"
@@ -25,6 +24,8 @@ const (
Exp1
)
+var ErrUnknownSet = errors.New("Unknown set")
+
func (si SetIdentifier) String() string {
switch si {
case Base:
@@ -119,7 +120,6 @@ func (set SetIdentifier) CardPaths() []string {
}
func SetListToSets(setList string) ([]SetIdentifier, error) {
- var err error
sets := []SetIdentifier{}
setList = strings.Replace(setList, " ", "", 0)
setsRaw := strings.Split(setList, ",")
@@ -128,8 +128,8 @@ func SetListToSets(setList string) ([]SetIdentifier, error) {
if found {
sets = append(sets, set)
} else {
- err = errors.New(fmt.Sprintf("Unknown set: %s", set))
+ return sets, ErrUnknownSet
}
}
- return sets, err
+ return sets, nil
}