From 36b591d2ce3f2b7cecff93cb9efad711ccf94810 Mon Sep 17 00:00:00 2001 From: smx_Moragn <1048492656@qq.com> Date: Tue, 22 Oct 2024 20:27:00 +0800 Subject: [PATCH] update nacos_test registry's name --- registry/nacos/nacoshertz/v2/nacos_test.go | 6 +++--- registry/nacos/nacoskitex/v2/go.sum | 2 ++ .../nacos/nacoskitex/v2/registry/registry.go | 18 ------------------ 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/registry/nacos/nacoshertz/v2/nacos_test.go b/registry/nacos/nacoshertz/v2/nacos_test.go index f960428..c8d2a70 100644 --- a/registry/nacos/nacoshertz/v2/nacos_test.go +++ b/registry/nacos/nacoshertz/v2/nacos_test.go @@ -185,7 +185,7 @@ func TestResolverResolve(t *testing.T) { h := server.Default( server.WithHostPorts("127.0.0.1:8080"), server.WithRegistry(NewNacosRegistry(namingClient), ®istry.Info{ - ServiceName: "demo.hertz-contrib.local", + ServiceName: "demo.hertz-contrib.local.v2", Addr: utils.NewNetAddr("tcp", "127.0.0.1:8080"), Weight: 10, }), @@ -215,7 +215,7 @@ func TestResolverResolve(t *testing.T) { name: "common", args: args{ ctx: context.Background(), - desc: "demo.hertz-contrib.local", + desc: "demo.hertz-contrib.local.v2", }, fields: fields{cli: namingClient}, }, @@ -246,7 +246,7 @@ func TestResolverResolve(t *testing.T) { } err := NewNacosRegistry(namingClient).Deregister(®istry.Info{ - ServiceName: "demo.hertz-contrib.local", + ServiceName: "demo.hertz-contrib.local.v2", Addr: utils.NewNetAddr("tcp", "127.0.0.1:8080"), Weight: 10, }) diff --git a/registry/nacos/nacoskitex/v2/go.sum b/registry/nacos/nacoskitex/v2/go.sum index b0becfa..858f999 100644 --- a/registry/nacos/nacoskitex/v2/go.sum +++ b/registry/nacos/nacoskitex/v2/go.sum @@ -294,6 +294,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smx-Morgan/cwgo-pkg/registry/nacos/options v0.0.0-20241022073704-d890c90bd175 h1:IspUo+wWieS7YAehC5URSDHPAcQiiTrjjDM0EcDAZLI= +github.com/smx-Morgan/cwgo-pkg/registry/nacos/options v0.0.0-20241022073704-d890c90bd175/go.mod h1:KwHwHQj6iF1QOLUzZNj+OvSjlZqa7oYKDXgL7M52fMo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/registry/nacos/nacoskitex/v2/registry/registry.go b/registry/nacos/nacoskitex/v2/registry/registry.go index 4f9d921..8980579 100644 --- a/registry/nacos/nacoskitex/v2/registry/registry.go +++ b/registry/nacos/nacoskitex/v2/registry/registry.go @@ -28,24 +28,6 @@ import ( "github.com/nacos-group/nacos-sdk-go/v2/vo" ) -/*type options struct { - cluster string - group string -} - -// Option is nacos option. -type Option func(o *options) - -// WithCluster with cluster option. -func WithCluster(cluster string) Option { - return func(o *options) { o.cluster = cluster } -} - -// WithGroup with group option. -func WithGroup(group string) Option { - return func(o *options) { o.group = group } -}*/ - type nacosRegistry struct { cli naming_client.INamingClient opts options.Options