diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index a7678ba4e2f38cfeb77f202103e03066a7efdbef..4976d34ecc9147b661de0609e41e6c4d28bdd6cc 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -44,7 +44,7 @@ import ( ) var ( - regProtocol *registryProtocol + regProtocol = newRegistryProtocol() ) type registryProtocol struct { @@ -348,10 +348,7 @@ func setProviderUrl(regURL *common.URL, providerURL *common.URL) { // GetProtocol ... func GetProtocol() protocol.Protocol { - if regProtocol != nil { - return regProtocol - } - return newRegistryProtocol() + return regProtocol } type wrappedInvoker struct {