From 044d1ad61c54aff9d36840dc07b1d59ad4478702 Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Thu, 30 Mar 2023 10:28:16 +0800 Subject: [PATCH] refactor:remove providers: prefix when use polaris --- common/constant/default.go | 4 +++- protocol/dubbo3/dubbo3_invoker.go | 3 ++- protocol/dubbo3/dubbo3_protocol.go | 3 ++- protocol/grpc/client.go | 1 + protocol/grpc/client_test.go | 3 ++- protocol/grpc/server.go | 1 + registry/polaris/registry.go | 2 +- tools/dubbogo-cli/cmd/show.go | 3 ++- 8 files changed, 14 insertions(+), 6 deletions(-) diff --git a/common/constant/default.go b/common/constant/default.go index 8c0f4ffbd3..49b764565f 100644 --- a/common/constant/default.go +++ b/common/constant/default.go @@ -17,7 +17,9 @@ package constant -import "math" +import ( + "math" +) const ( Dubbo = "dubbo" diff --git a/protocol/dubbo3/dubbo3_invoker.go b/protocol/dubbo3/dubbo3_invoker.go index 29f2af03fa..327b58d3bd 100644 --- a/protocol/dubbo3/dubbo3_invoker.go +++ b/protocol/dubbo3/dubbo3_invoker.go @@ -28,13 +28,14 @@ import ( import ( "github.com/dubbogo/gost/log/logger" - "github.com/dustin/go-humanize" "github.com/dubbogo/grpc-go/metadata" tripleConstant "github.com/dubbogo/triple/pkg/common/constant" triConfig "github.com/dubbogo/triple/pkg/config" "github.com/dubbogo/triple/pkg/triple" + + "github.com/dustin/go-humanize" ) import ( diff --git a/protocol/dubbo3/dubbo3_protocol.go b/protocol/dubbo3/dubbo3_protocol.go index ea5a9ece83..66caf28362 100644 --- a/protocol/dubbo3/dubbo3_protocol.go +++ b/protocol/dubbo3/dubbo3_protocol.go @@ -26,7 +26,6 @@ import ( import ( "github.com/dubbogo/gost/log/logger" - "github.com/dustin/go-humanize" "github.com/dubbogo/grpc-go" "github.com/dubbogo/grpc-go/metadata" @@ -34,6 +33,8 @@ import ( tripleConstant "github.com/dubbogo/triple/pkg/common/constant" triConfig "github.com/dubbogo/triple/pkg/config" "github.com/dubbogo/triple/pkg/triple" + + "github.com/dustin/go-humanize" ) import ( diff --git a/protocol/grpc/client.go b/protocol/grpc/client.go index fdb127858b..2d6ad4da7d 100644 --- a/protocol/grpc/client.go +++ b/protocol/grpc/client.go @@ -25,6 +25,7 @@ import ( import ( "github.com/dubbogo/gost/log/logger" + "github.com/dustin/go-humanize" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" diff --git a/protocol/grpc/client_test.go b/protocol/grpc/client_test.go index 4dc48689e8..0b87c12838 100644 --- a/protocol/grpc/client_test.go +++ b/protocol/grpc/client_test.go @@ -20,11 +20,12 @@ package grpc import ( "context" "fmt" - "github.com/dustin/go-humanize" "testing" ) import ( + "github.com/dustin/go-humanize" + "github.com/stretchr/testify/assert" ) diff --git a/protocol/grpc/server.go b/protocol/grpc/server.go index f1538630c7..5efd3171d3 100644 --- a/protocol/grpc/server.go +++ b/protocol/grpc/server.go @@ -27,6 +27,7 @@ import ( import ( "github.com/dubbogo/gost/log/logger" + "github.com/dustin/go-humanize" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" diff --git a/registry/polaris/registry.go b/registry/polaris/registry.go index 56172c065f..dad5ea0588 100644 --- a/registry/polaris/registry.go +++ b/registry/polaris/registry.go @@ -122,7 +122,7 @@ func (pr *polarisRegistry) UnRegister(url *common.URL) error { request := createDeregisterParam(url, url.Interface()) request.Namespace = pr.namespace if err := pr.provider.Deregister(request); err != nil { - return perrors.WithMessagef(err, "register(conf:%+v)", url) + return perrors.WithMessagef(err, "fail to deregister(conf:%+v)", url) } return nil } diff --git a/tools/dubbogo-cli/cmd/show.go b/tools/dubbogo-cli/cmd/show.go index 991cbe5d11..d730eae1a4 100644 --- a/tools/dubbogo-cli/cmd/show.go +++ b/tools/dubbogo-cli/cmd/show.go @@ -25,8 +25,9 @@ import ( ) import ( - "github.com/spf13/cobra" "github.com/olekukonko/tablewriter" + + "github.com/spf13/cobra" ) import (