From 87b97ca4b2f39240c698596ac14a6d3532f6363d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 15 Feb 2020 13:45:14 +0100 Subject: bridges: more refactor and cleanup --- bridge/core/bridge.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bridge/core/bridge.go') diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go index 62fd70f6..c72ff6b4 100644 --- a/bridge/core/bridge.go +++ b/bridge/core/bridge.go @@ -52,7 +52,7 @@ func Register(impl BridgeImpl) { if bridgeLoginMetaKey == nil { bridgeLoginMetaKey = make(map[string]string) } - bridgeImpl[impl.Target()] = reflect.TypeOf(impl) + bridgeImpl[impl.Target()] = reflect.TypeOf(impl).Elem() bridgeLoginMetaKey[impl.Target()] = impl.LoginMetaKey() } @@ -94,7 +94,7 @@ func NewBridge(repo *cache.RepoCache, target string, name string) (*Bridge, erro return nil, fmt.Errorf("unknown bridge target %v", target) } - impl := reflect.New(implType).Elem().Interface().(BridgeImpl) + impl := reflect.New(implType).Interface().(BridgeImpl) bridge := &Bridge{ Name: name, -- cgit