aboutsummaryrefslogtreecommitdiffstats
path: root/identity/common.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-08-12 16:12:14 +0200
committerMichael Muré <batolettre@gmail.com>2019-08-12 16:12:14 +0200
commit99b5c58d43137bd9f6503788a55484327b0c531f (patch)
tree08ecc0f923b5f1fb4e8a7627aeabccb335d92ad1 /identity/common.go
parent67a3752e176790e82a48706236f889cab4f8913d (diff)
downloadgit-bug-99b5c58d43137bd9f6503788a55484327b0c531f.tar.gz
finish the refactoring for the dedicated identifier type
Diffstat (limited to 'identity/common.go')
-rw-r--r--identity/common.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/identity/common.go b/identity/common.go
index 68a6d57c..007e10d6 100644
--- a/identity/common.go
+++ b/identity/common.go
@@ -4,17 +4,14 @@ import (
"encoding/json"
"errors"
"fmt"
- "strings"
+
+ "github.com/MichaelMure/git-bug/entity"
)
var ErrIdentityNotExist = errors.New("identity doesn't exist")
-type ErrMultipleMatch struct {
- Matching []string
-}
-
-func (e ErrMultipleMatch) Error() string {
- return fmt.Sprintf("Multiple matching identities found:\n%s", strings.Join(e.Matching, "\n"))
+func NewErrMultipleMatch(matching []entity.Id) *entity.ErrMultipleMatch {
+ return entity.NewErrMultipleMatch("identity", matching)
}
// Custom unmarshaling function to allow package user to delegate