From 7e798fc34d703770e3391de8ecd65edea0d40181 Mon Sep 17 00:00:00 2001 From: Antonio Jesus Navarro Perez Date: Tue, 16 May 2017 16:08:20 +0200 Subject: transport/server: use Endpoint string representation as a map key. Two endpoints are not equals between them, even if they were generated using the same url or path. --- plumbing/transport/server/loader.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plumbing/transport/server/loader.go') diff --git a/plumbing/transport/server/loader.go b/plumbing/transport/server/loader.go index b51a795..386c2f0 100644 --- a/plumbing/transport/server/loader.go +++ b/plumbing/transport/server/loader.go @@ -44,13 +44,13 @@ func (l *fsLoader) Load(ep transport.Endpoint) (storer.Storer, error) { // MapLoader is a Loader that uses a lookup map of storer.Storer by // transport.Endpoint. -type MapLoader map[transport.Endpoint]storer.Storer +type MapLoader map[string]storer.Storer // Load returns a storer.Storer for given a transport.Endpoint by looking it up // in the map. Returns transport.ErrRepositoryNotFound if the endpoint does not // exist. func (l MapLoader) Load(ep transport.Endpoint) (storer.Storer, error) { - s, ok := l[ep] + s, ok := l[ep.String()] if !ok { return nil, transport.ErrRepositoryNotFound } -- cgit