diff options
author | Michael Muré <batolettre@gmail.com> | 2019-08-11 14:08:03 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-08-11 14:08:03 +0200 |
commit | 67a3752e176790e82a48706236f889cab4f8913d (patch) | |
tree | 113251396fc2569d1db2c2e6fcadb30289b3aa96 /identity/resolver.go | |
parent | a0dfc202117e31e01d2d6ec701a41292df35d35d (diff) | |
download | git-bug-67a3752e176790e82a48706236f889cab4f8913d.tar.gz |
bug,entity: use a dedicated type to store IDs
Diffstat (limited to 'identity/resolver.go')
-rw-r--r-- | identity/resolver.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/identity/resolver.go b/identity/resolver.go index 7facfc0c..70fac74c 100644 --- a/identity/resolver.go +++ b/identity/resolver.go @@ -1,11 +1,14 @@ package identity -import "github.com/MichaelMure/git-bug/repository" +import ( + "github.com/MichaelMure/git-bug/entity" + "github.com/MichaelMure/git-bug/repository" +) // Resolver define the interface of an Identity resolver, able to load // an identity from, for example, a repo or a cache. type Resolver interface { - ResolveIdentity(id string) (Interface, error) + ResolveIdentity(id entity.Id) (Interface, error) } // DefaultResolver is a Resolver loading Identities directly from a Repo @@ -17,6 +20,6 @@ func NewSimpleResolver(repo repository.Repo) *SimpleResolver { return &SimpleResolver{repo: repo} } -func (r *SimpleResolver) ResolveIdentity(id string) (Interface, error) { +func (r *SimpleResolver) ResolveIdentity(id entity.Id) (Interface, error) { return ReadLocal(r.repo, id) } |