From 397c678b3a874b5d92c07643848ba606033b313f Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 15:23:23 +0800 Subject: [PATCH 1/7] fix: fix custom filter samples --- .run/custom-server.run.xml | 14 ++++++++ filter/custom/go-client/cmd/client.go | 26 ++++---------- filter/custom/go-client/cmd/myfilter.go | 32 +++++++++++++++++ filter/custom/go-client/conf/dubbogo.yml | 7 ++-- filter/custom/go-server/cmd/myfilter.go | 32 +++++++++++++++++ .../pkg/user.go => go-server/cmd/server.go} | 34 +++++++++++++------ filter/custom/go-server/conf/dubbogo.yml | 9 ++--- go.mod | 6 ++-- go.sum | 25 +++++++------- 9 files changed, 133 insertions(+), 52 deletions(-) create mode 100644 .run/custom-server.run.xml create mode 100644 filter/custom/go-client/cmd/myfilter.go create mode 100644 filter/custom/go-server/cmd/myfilter.go rename filter/custom/{go-client/pkg/user.go => go-server/cmd/server.go} (53%) diff --git a/.run/custom-server.run.xml b/.run/custom-server.run.xml new file mode 100644 index 000000000..7c5d1b321 --- /dev/null +++ b/.run/custom-server.run.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/filter/custom/go-client/cmd/client.go b/filter/custom/go-client/cmd/client.go index 95ae40f6b..54cfe945a 100644 --- a/filter/custom/go-client/cmd/client.go +++ b/filter/custom/go-client/cmd/client.go @@ -19,26 +19,22 @@ package main import ( "context" - "time" ) import ( "dubbo.apache.org/dubbo-go/v3/common/logger" "dubbo.apache.org/dubbo-go/v3/config" _ "dubbo.apache.org/dubbo-go/v3/imports" - - hessian "github.com/apache/dubbo-go-hessian2" ) import ( - "github.com/apache/dubbo-go-samples/filter/custom/go-client/pkg" + "github.com/apache/dubbo-go-samples/api" ) -var userProvider = &pkg.UserProvider{} +var userProvider = &api.GreeterClientImpl{} func init() { config.SetConsumerService(userProvider) - hessian.RegisterPOJO(&pkg.User{}) } func main() { @@ -47,18 +43,10 @@ func main() { panic(err) } - var successCount, failCount int64 - logger.Infof("\n\n\nstart to test dubbo") - for i := 0; i < 60; i++ { - time.Sleep(200 * time.Millisecond) - user, err := userProvider.GetUser(context.TODO(), "A001") - if err != nil { - failCount++ - logger.Infof("error: %v\n", err) - } else { - successCount++ - } - logger.Infof("response: %v\n", user) + logger.Infof("\n\n\nstart to test") + user, err := userProvider.SayHello(context.TODO(), &api.HelloRequest{Name: "laurence"}) + if err != nil { + panic(err) } - logger.Infof("failCount=%v, failCount=%v\n", successCount, failCount) + logger.Infof("get user = %+v", user) } diff --git a/filter/custom/go-client/cmd/myfilter.go b/filter/custom/go-client/cmd/myfilter.go new file mode 100644 index 000000000..02d0c8964 --- /dev/null +++ b/filter/custom/go-client/cmd/myfilter.go @@ -0,0 +1,32 @@ +package main + +import ( + "context" + "fmt" +) + +import ( + "dubbo.apache.org/dubbo-go/v3/common/extension" + "dubbo.apache.org/dubbo-go/v3/filter" + "dubbo.apache.org/dubbo-go/v3/protocol" +) + +func init() { + extension.SetFilter("myClientFilter", NewMyClientFilter) +} + +func NewMyClientFilter() filter.Filter { + return &MyClientFilter{} +} + +type MyClientFilter struct { +} + +func (f *MyClientFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { + fmt.Println("MyClientFilter Invoke is called, method Name = ", invocation.MethodName()) + return invoker.Invoke(ctx, invocation) +} +func (f *MyClientFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, protocol protocol.Invocation) protocol.Result { + fmt.Println("MyClientFilter OnResponse is called") + return result +} diff --git a/filter/custom/go-client/conf/dubbogo.yml b/filter/custom/go-client/conf/dubbogo.yml index 4617a7edf..e2493db6d 100644 --- a/filter/custom/go-client/conf/dubbogo.yml +++ b/filter/custom/go-client/conf/dubbogo.yml @@ -3,16 +3,17 @@ dubbo: registries: demoZK: - protocolIDs: zookeeper + protocol: zookeeper timeout: 3s address: 127.0.0.1:2181 consumer: + filter: myClientFilter check: true request_timeout: 3s connect_timeout: 3s registryIDs: - demoZK references: - UserProvider: - protocolIDs: dubbo + GreeterClientImpl: + protocol: tri interface: org.apache.dubbo.UserProvider \ No newline at end of file diff --git a/filter/custom/go-server/cmd/myfilter.go b/filter/custom/go-server/cmd/myfilter.go new file mode 100644 index 000000000..5e5a54e5e --- /dev/null +++ b/filter/custom/go-server/cmd/myfilter.go @@ -0,0 +1,32 @@ +package main + +import ( + "context" + "fmt" +) + +import ( + "dubbo.apache.org/dubbo-go/v3/common/extension" + "dubbo.apache.org/dubbo-go/v3/filter" + "dubbo.apache.org/dubbo-go/v3/protocol" +) + +func init() { + extension.SetFilter("myServerFilter", NewMyServerFilter) +} + +func NewMyServerFilter() filter.Filter { + return &MyServerFilter{} +} + +type MyServerFilter struct { +} + +func (f *MyServerFilter) Invoke(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) protocol.Result { + fmt.Println("MyServerFilter Invoke is called, method Name = ", invocation.MethodName()) + return invoker.Invoke(ctx, invocation) +} +func (f *MyServerFilter) OnResponse(ctx context.Context, result protocol.Result, invoker protocol.Invoker, protocol protocol.Invocation) protocol.Result { + fmt.Println("MyServerFilter OnResponse is called") + return result +} diff --git a/filter/custom/go-client/pkg/user.go b/filter/custom/go-server/cmd/server.go similarity index 53% rename from filter/custom/go-client/pkg/user.go rename to filter/custom/go-server/cmd/server.go index 505abac4e..151424047 100644 --- a/filter/custom/go-client/pkg/user.go +++ b/filter/custom/go-server/cmd/server.go @@ -15,24 +15,36 @@ * limitations under the License. */ -package pkg +package main import ( "context" - "time" ) -type User struct { - ID string - Name string - Age int32 - Time time.Time +import ( + "dubbo.apache.org/dubbo-go/v3/common/logger" + "dubbo.apache.org/dubbo-go/v3/config" + _ "dubbo.apache.org/dubbo-go/v3/imports" +) + +import ( + "github.com/apache/dubbo-go-samples/api" +) + +type GreeterProvider struct { + api.GreeterProviderBase } -type UserProvider struct { - GetUser func(ctx context.Context, req string) (*User, error) +func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest) (*api.User, error) { + logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name) + return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil } -func (u *User) JavaClassName() string { - return "org.apache.dubbo.User" +// export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-server/conf/dubbogo.yml +func main() { + config.SetProviderService(&GreeterProvider{}) + if err := config.Load(); err != nil { + panic(err) + } + select {} } diff --git a/filter/custom/go-server/conf/dubbogo.yml b/filter/custom/go-server/conf/dubbogo.yml index 7dd1d1f99..a2206796f 100644 --- a/filter/custom/go-server/conf/dubbogo.yml +++ b/filter/custom/go-server/conf/dubbogo.yml @@ -5,15 +5,16 @@ dubbo: timeout: 3s address: 127.0.0.1:2181 protocols: - dubbo: - name: dubbo + tripleProtocol: + name: tri port: 20000 provider: registryIDs: - demoZK services: - UserProvider: - protocolIDs: dubbo + GreeterProvider: + filter: myServerFilter + protocolIDs: tripleProtocol interface: org.apache.dubbo.UserProvider loadbalance: random warmup: 100 diff --git a/go.mod b/go.mod index 487cb1d65..6c2a65860 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/apache/dubbo-go-samples require ( - dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211009125508-c22d9c3e529f + dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac github.com/apache/dubbo-go-hessian2 v1.9.4-0.20210917102639-74a8ece5f3cb - github.com/dubbogo/gost v1.11.17 + github.com/dubbogo/gost v1.11.18 github.com/dubbogo/net v0.0.4 - github.com/dubbogo/triple v1.0.6-0.20210909153707-3620c8d2d97c + github.com/dubbogo/triple v1.0.7 github.com/golang/protobuf v1.5.2 github.com/opentracing/opentracing-go v1.2.0 github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 diff --git a/go.sum b/go.sum index d9f035894..c9de73f83 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211009125508-c22d9c3e529f h1:lnsaQyqORbYblY8f6SiVfdnp+l03Qbh1lCsnKPIXJro= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211009125508-c22d9c3e529f/go.mod h1:84/HH7kK42HDa3DXrtj0Eyy2bVBstV3Z3sF0s4NcXZY= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac h1:fxTXz6ooBaAwNHq46Ov4u8EN5pipmqP55DOVy5mgfQo= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac/go.mod h1:fmHYUVOzshW8zsyicHgAVK6WZRRMkwqHWVkesbsT8ec= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -181,14 +181,13 @@ github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl8 github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= github.com/dubbogo/gost v1.11.12/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= -github.com/dubbogo/gost v1.11.16/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= -github.com/dubbogo/gost v1.11.17 h1:Dwaoqv/G21nYsGkeQoLbCAOryRPl6B7pEsZSJcr55nE= -github.com/dubbogo/gost v1.11.17/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= +github.com/dubbogo/gost v1.11.18 h1:e9WRvDQut6cePYcQEOUC15vGSfftO7q9G2+Vw2s4CHE= +github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= github.com/dubbogo/net v0.0.4 h1:Rn9aMPZwOiRE22YhtxmDEE3H0Q3cfVRNhuEjNMelJ/8= github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc= -github.com/dubbogo/triple v1.0.6-0.20210909153707-3620c8d2d97c h1:/Qrdqo2JVrywDANk04DHrvdfREdIApAWZ6stbYZfNaM= -github.com/dubbogo/triple v1.0.6-0.20210909153707-3620c8d2d97c/go.mod h1:KbfU/uZDv+fJEqXYK3qI8m1iuBQ309QxiC0tvTf2pog= +github.com/dubbogo/triple v1.0.7 h1:rPRtf5QNQO2FqXckMugn8KmQyhXQPZyImrEJ/OKAB7o= +github.com/dubbogo/triple v1.0.7/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -201,8 +200,8 @@ github.com/elazarl/go-bindata-assetfs v1.0.1/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful/v3 v3.7.0 h1:j0vVy2jEc6pJb7dBZkkqXP0mvggYEVUA9upClUMsCts= -github.com/emicklei/go-restful/v3 v3.7.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.7.1 h1:R5iagkkTsfFpe1nce6Yniw3wmSx0Qw5YP469YzRFNEs= +github.com/emicklei/go-restful/v3 v3.7.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -234,8 +233,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= -github.com/go-co-op/gocron v0.1.1 h1:OfDmkqkCguFtFMsm6Eaayci3DADLa8pXvdmOlPU/JcU= -github.com/go-co-op/gocron v0.1.1/go.mod h1:Y9PWlYqDChf2Nbgg7kfS+ZsXHDTZbMZYPEQ0MILqH+M= +github.com/go-co-op/gocron v1.9.0 h1:+V+DDenw3ryB7B+tK1bAIC5p0ruw4oX9IqAsdRnGIf0= +github.com/go-co-op/gocron v1.9.0/go.mod h1:DbJm9kdgr1sEvWpHCA7dFFs/PGHPMil9/97EXCRPr4k= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -266,7 +265,6 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.9.0 h1:NgTtmN58D0m8+UuxtYmGztBJB7VnPgjj221I1QHci2A= github.com/go-playground/validator/v10 v10.9.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-redis/redis v6.15.5+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -672,6 +670,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/robertkrimen/godocdown v0.0.0-20130622164427-0bfa04905481/go.mod h1:C9WhFzY47SzYBIvzFqSvHIR6ROgDo4TtdTuRaOMjF/s= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -938,6 +938,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 28b6a2b72a3a69cf84fb5efda9bcaaad0c393aa9 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 15:24:25 +0800 Subject: [PATCH 2/7] fix: add golang .run --- .run/custom-client.run.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .run/custom-client.run.xml diff --git a/.run/custom-client.run.xml b/.run/custom-client.run.xml new file mode 100644 index 000000000..a2739f6b1 --- /dev/null +++ b/.run/custom-client.run.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file From e78917124f06a0c8650bd95f664ca696c02b284b Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 15:39:06 +0800 Subject: [PATCH 3/7] fix: remove useless sleep --- .../configcenter/nacos/go-client/cmd/client.go | 3 --- .../zookeeper/go-client/cmd/client.go | 3 --- config-api/rpc/triple/go-client/cmd/client.go | 3 --- configcenter/apollo/go-client/cmd/client.go | 2 -- configcenter/nacos/go-client/cmd/client.go | 2 -- configcenter/zookeeper/go-client/cmd/client.go | 2 -- context/triple/go-client/cmd/client.go | 2 -- direct/go-client/cmd/client.go | 2 -- filter/custom/go-client/cmd/myfilter.go | 17 +++++++++++++++++ filter/custom/go-server/cmd/myfilter.go | 17 +++++++++++++++++ helloworld/go-client/cmd/client.go | 2 -- .../apollo/tests/integration/main_test.go | 2 -- .../nacos/tests/integration/main_test.go | 1 - .../dubbo/tests/integration/main_test.go | 2 -- .../direct/tests/integration/main_test.go | 2 -- .../custom/tests/integration/main_test.go | 1 - .../tests/integration/main_test.go | 2 -- .../tests/integration/main_test.go | 2 -- .../helloworld/tests/integration/main_test.go | 2 -- .../etcd/tests/integration/main_test.go | 2 +- .../nacos/tests/integration/main_test.go | 2 +- .../nacos/tests/integration/main_test.go | 2 -- .../zookeeper/tests/integration/main_test.go | 2 -- .../zookeeper/tests/integration/main_test.go | 2 -- .../rpc/dubbo/tests/integration/main_test.go | 1 - .../rpc/grpc/tests/integration/main_test.go | 2 -- .../rpc/jsonrpc/tests/integration/main_test.go | 3 --- .../tests/integration/main_test.go | 3 +-- .../hessian2/tests/integration/main_test.go | 3 +-- .../msgpack/tests/integration/main_test.go | 3 +-- .../dubbogo-grpc/tests/integration/main_test.go | 2 -- registry/etcd/go-client/cmd/client.go | 2 -- registry/nacos/go-client/cmd/client.go | 1 - .../nacos/go-client/cmd/client.go | 2 -- .../zookeeper/go-client/cmd/client.go | 2 -- registry/zookeeper/go-client/cmd/client.go | 2 -- rpc/dubbo/go-client/cmd/client.go | 3 --- rpc/grpc/go-client/cmd/client.go | 2 -- .../codec-extension/go-client/cmd/client.go | 3 +-- rpc/triple/hessian2/go-client/cmd/client.go | 2 -- rpc/triple/msgpack/go-client/cmd/client.go | 2 -- .../pb/dubbogo-grpc/go-client/cmd/client.go | 2 -- .../pb/dubbogo-java/go-client/cmd/client.go | 2 -- 43 files changed, 40 insertions(+), 81 deletions(-) diff --git a/config-api/configcenter/nacos/go-client/cmd/client.go b/config-api/configcenter/nacos/go-client/cmd/client.go index fbaee5885..6c63543da 100644 --- a/config-api/configcenter/nacos/go-client/cmd/client.go +++ b/config-api/configcenter/nacos/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -75,8 +74,6 @@ func main() { panic(err) } - time.Sleep(3 * time.Second) - logger.Info("start to test dubbo") req := &api.HelloRequest{ Name: "laurence", diff --git a/config-api/configcenter/zookeeper/go-client/cmd/client.go b/config-api/configcenter/zookeeper/go-client/cmd/client.go index bf88cbbb9..cadde7a68 100644 --- a/config-api/configcenter/zookeeper/go-client/cmd/client.go +++ b/config-api/configcenter/zookeeper/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -73,8 +72,6 @@ func main() { panic(err) } - time.Sleep(3 * time.Second) - logger.Info("start to test dubbo") req := &api.HelloRequest{ Name: "laurence", diff --git a/config-api/rpc/triple/go-client/cmd/client.go b/config-api/rpc/triple/go-client/cmd/client.go index 2863f0b3b..196b67d39 100644 --- a/config-api/rpc/triple/go-client/cmd/client.go +++ b/config-api/rpc/triple/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -53,8 +52,6 @@ func main() { panic(err) } - time.Sleep(3 * time.Second) - logger.Info("start to test dubbo") req := &api.HelloRequest{ Name: "laurence", diff --git a/configcenter/apollo/go-client/cmd/client.go b/configcenter/apollo/go-client/cmd/client.go index 2c0c7adf9..2a57b2132 100644 --- a/configcenter/apollo/go-client/cmd/client.go +++ b/configcenter/apollo/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -41,7 +40,6 @@ func init() { // export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml func main() { config.Load() - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/configcenter/nacos/go-client/cmd/client.go b/configcenter/nacos/go-client/cmd/client.go index 2c0c7adf9..2a57b2132 100644 --- a/configcenter/nacos/go-client/cmd/client.go +++ b/configcenter/nacos/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -41,7 +40,6 @@ func init() { // export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml func main() { config.Load() - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/configcenter/zookeeper/go-client/cmd/client.go b/configcenter/zookeeper/go-client/cmd/client.go index 2c0c7adf9..2a57b2132 100644 --- a/configcenter/zookeeper/go-client/cmd/client.go +++ b/configcenter/zookeeper/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -41,7 +40,6 @@ func init() { // export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml func main() { config.Load() - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/context/triple/go-client/cmd/client.go b/context/triple/go-client/cmd/client.go index b6109bbc2..ca7f1fdad 100644 --- a/context/triple/go-client/cmd/client.go +++ b/context/triple/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -43,7 +42,6 @@ func init() { // export DUBBO_GO_CONFIG_PATH= PATH_TO_SAMPLES/helloworld/go-client/conf/dubbogo.yml func main() { config.Load() - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/direct/go-client/cmd/client.go b/direct/go-client/cmd/client.go index 59596d645..80c9ab8a0 100644 --- a/direct/go-client/cmd/client.go +++ b/direct/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -40,7 +39,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/filter/custom/go-client/cmd/myfilter.go b/filter/custom/go-client/cmd/myfilter.go index 02d0c8964..a3f59e073 100644 --- a/filter/custom/go-client/cmd/myfilter.go +++ b/filter/custom/go-client/cmd/myfilter.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package main import ( diff --git a/filter/custom/go-server/cmd/myfilter.go b/filter/custom/go-server/cmd/myfilter.go index 5e5a54e5e..261884a30 100644 --- a/filter/custom/go-server/cmd/myfilter.go +++ b/filter/custom/go-server/cmd/myfilter.go @@ -1,3 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package main import ( diff --git a/helloworld/go-client/cmd/client.go b/helloworld/go-client/cmd/client.go index 59596d645..80c9ab8a0 100644 --- a/helloworld/go-client/cmd/client.go +++ b/helloworld/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -40,7 +39,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/integrate_test/configcenter/apollo/tests/integration/main_test.go b/integrate_test/configcenter/apollo/tests/integration/main_test.go index fefd88952..8e8355b9f 100644 --- a/integrate_test/configcenter/apollo/tests/integration/main_test.go +++ b/integrate_test/configcenter/apollo/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = new(dubbo3pb.GreeterClientImpl) func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/configcenter/nacos/tests/integration/main_test.go b/integrate_test/configcenter/nacos/tests/integration/main_test.go index 8c876ab80..fdb84904f 100644 --- a/integrate_test/configcenter/nacos/tests/integration/main_test.go +++ b/integrate_test/configcenter/nacos/tests/integration/main_test.go @@ -37,7 +37,6 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/context/dubbo/tests/integration/main_test.go b/integrate_test/context/dubbo/tests/integration/main_test.go index 6749caf13..c7a69938d 100644 --- a/integrate_test/context/dubbo/tests/integration/main_test.go +++ b/integrate_test/context/dubbo/tests/integration/main_test.go @@ -21,7 +21,6 @@ import ( "context" "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&ContextContent{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/direct/tests/integration/main_test.go b/integrate_test/direct/tests/integration/main_test.go index fefd88952..8e8355b9f 100644 --- a/integrate_test/direct/tests/integration/main_test.go +++ b/integrate_test/direct/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = new(dubbo3pb.GreeterClientImpl) func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/filter/custom/tests/integration/main_test.go b/integrate_test/filter/custom/tests/integration/main_test.go index 7dbd7f51e..44a14621b 100644 --- a/integrate_test/filter/custom/tests/integration/main_test.go +++ b/integrate_test/filter/custom/tests/integration/main_test.go @@ -39,7 +39,6 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/game/go-server-game/tests/integration/main_test.go b/integrate_test/game/go-server-game/tests/integration/main_test.go index 3ecb6ceca..72c7295be 100644 --- a/integrate_test/game/go-server-game/tests/integration/main_test.go +++ b/integrate_test/game/go-server-game/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -42,7 +41,6 @@ func TestMain(m *testing.M) { hessian.RegisterPOJO(&pojo.Result{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/game/go-server-gate/tests/integration/main_test.go b/integrate_test/game/go-server-gate/tests/integration/main_test.go index 91abb1733..489907853 100644 --- a/integrate_test/game/go-server-gate/tests/integration/main_test.go +++ b/integrate_test/game/go-server-gate/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -42,7 +41,6 @@ func TestMain(m *testing.M) { hessian.RegisterPOJO(&pojo.Result{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/helloworld/tests/integration/main_test.go b/integrate_test/helloworld/tests/integration/main_test.go index fefd88952..8e8355b9f 100644 --- a/integrate_test/helloworld/tests/integration/main_test.go +++ b/integrate_test/helloworld/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = new(dubbo3pb.GreeterClientImpl) func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/registry/etcd/tests/integration/main_test.go b/integrate_test/registry/etcd/tests/integration/main_test.go index 0fe7ad20a..4975d4546 100644 --- a/integrate_test/registry/etcd/tests/integration/main_test.go +++ b/integrate_test/registry/etcd/tests/integration/main_test.go @@ -45,7 +45,7 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&pkg.User{}) config.Load() - time.Sleep(3 * time.Second) + os.Exit(m.Run()) } diff --git a/integrate_test/registry/nacos/tests/integration/main_test.go b/integrate_test/registry/nacos/tests/integration/main_test.go index 2b9896722..589a882d2 100644 --- a/integrate_test/registry/nacos/tests/integration/main_test.go +++ b/integrate_test/registry/nacos/tests/integration/main_test.go @@ -39,7 +39,7 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) + os.Exit(m.Run()) } diff --git a/integrate_test/registry/servicediscovery/nacos/tests/integration/main_test.go b/integrate_test/registry/servicediscovery/nacos/tests/integration/main_test.go index fab1dcb06..cbc239d15 100644 --- a/integrate_test/registry/servicediscovery/nacos/tests/integration/main_test.go +++ b/integrate_test/registry/servicediscovery/nacos/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = &dubbo3pb.GreeterClientImpl{} func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/registry/servicediscovery/zookeeper/tests/integration/main_test.go b/integrate_test/registry/servicediscovery/zookeeper/tests/integration/main_test.go index fab1dcb06..cbc239d15 100644 --- a/integrate_test/registry/servicediscovery/zookeeper/tests/integration/main_test.go +++ b/integrate_test/registry/servicediscovery/zookeeper/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = &dubbo3pb.GreeterClientImpl{} func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/registry/zookeeper/tests/integration/main_test.go b/integrate_test/registry/zookeeper/tests/integration/main_test.go index fab1dcb06..cbc239d15 100644 --- a/integrate_test/registry/zookeeper/tests/integration/main_test.go +++ b/integrate_test/registry/zookeeper/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var greeterProvider = &dubbo3pb.GreeterClientImpl{} func TestMain(m *testing.M) { config.SetConsumerService(greeterProvider) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/rpc/dubbo/tests/integration/main_test.go b/integrate_test/rpc/dubbo/tests/integration/main_test.go index 49d31b2e4..9345bb5ff 100644 --- a/integrate_test/rpc/dubbo/tests/integration/main_test.go +++ b/integrate_test/rpc/dubbo/tests/integration/main_test.go @@ -41,7 +41,6 @@ func TestMain(m *testing.M) { hessian.RegisterJavaEnum(Gender(WOMAN)) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/rpc/grpc/tests/integration/main_test.go b/integrate_test/rpc/grpc/tests/integration/main_test.go index c44de5abb..cda7d7e38 100644 --- a/integrate_test/rpc/grpc/tests/integration/main_test.go +++ b/integrate_test/rpc/grpc/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -37,7 +36,6 @@ var grpcGreeterImpl = new(pb.GreeterClientImpl) func TestMain(m *testing.M) { config.SetConsumerService(grpcGreeterImpl) config.Load() - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/integrate_test/rpc/jsonrpc/tests/integration/main_test.go b/integrate_test/rpc/jsonrpc/tests/integration/main_test.go index 34a6335d4..24e340f1f 100644 --- a/integrate_test/rpc/jsonrpc/tests/integration/main_test.go +++ b/integrate_test/rpc/jsonrpc/tests/integration/main_test.go @@ -19,7 +19,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -48,7 +47,5 @@ func TestMain(m *testing.M) { config.Load() - time.Sleep(3 * time.Second) - os.Exit(m.Run()) } diff --git a/integrate_test/rpc/triple/codec-extension/tests/integration/main_test.go b/integrate_test/rpc/triple/codec-extension/tests/integration/main_test.go index 0744f5e83..44d76fc23 100644 --- a/integrate_test/rpc/triple/codec-extension/tests/integration/main_test.go +++ b/integrate_test/rpc/triple/codec-extension/tests/integration/main_test.go @@ -21,7 +21,6 @@ import ( "context" "os" "testing" - "time" ) import ( @@ -34,7 +33,7 @@ var userProvider = new(UserProvider) func TestMain(m *testing.M) { config.SetConsumerService(userProvider) config.Load() - time.Sleep(3 * time.Second) + os.Exit(m.Run()) } diff --git a/integrate_test/rpc/triple/hessian2/tests/integration/main_test.go b/integrate_test/rpc/triple/hessian2/tests/integration/main_test.go index 9fac6e053..dec3dcf14 100644 --- a/integrate_test/rpc/triple/hessian2/tests/integration/main_test.go +++ b/integrate_test/rpc/triple/hessian2/tests/integration/main_test.go @@ -21,7 +21,6 @@ import ( "context" "os" "testing" - "time" ) import ( @@ -37,7 +36,7 @@ func TestMain(m *testing.M) { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) + os.Exit(m.Run()) } diff --git a/integrate_test/rpc/triple/msgpack/tests/integration/main_test.go b/integrate_test/rpc/triple/msgpack/tests/integration/main_test.go index 4c93a7bb0..e94ceccf5 100644 --- a/integrate_test/rpc/triple/msgpack/tests/integration/main_test.go +++ b/integrate_test/rpc/triple/msgpack/tests/integration/main_test.go @@ -21,7 +21,6 @@ import ( "context" "os" "testing" - "time" ) import ( @@ -38,7 +37,7 @@ var userProvider = new(UserProvider) func TestMain(m *testing.M) { config.SetConsumerService(userProvider) config.Load() - time.Sleep(3 * time.Second) + os.Exit(m.Run()) } diff --git a/integrate_test/rpc/triple/pb/dubbogo-grpc/tests/integration/main_test.go b/integrate_test/rpc/triple/pb/dubbogo-grpc/tests/integration/main_test.go index f066255a2..b19c54e11 100644 --- a/integrate_test/rpc/triple/pb/dubbogo-grpc/tests/integration/main_test.go +++ b/integrate_test/rpc/triple/pb/dubbogo-grpc/tests/integration/main_test.go @@ -20,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -39,7 +38,6 @@ func TestMain(m *testing.M) { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) os.Exit(m.Run()) } diff --git a/registry/etcd/go-client/cmd/client.go b/registry/etcd/go-client/cmd/client.go index bb4facf0b..44ed536b3 100644 --- a/registry/etcd/go-client/cmd/client.go +++ b/registry/etcd/go-client/cmd/client.go @@ -20,7 +20,6 @@ package main import ( "context" "os" - "time" ) import ( @@ -49,7 +48,6 @@ func init() { func main() { hessian.RegisterPOJO(&pkg.User{}) config.Load() - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") user := &pkg.User{ diff --git a/registry/nacos/go-client/cmd/client.go b/registry/nacos/go-client/cmd/client.go index e3feee4af..147db6def 100644 --- a/registry/nacos/go-client/cmd/client.go +++ b/registry/nacos/go-client/cmd/client.go @@ -53,7 +53,6 @@ func main() { config.SetConsumerService(userProvider) hessian.RegisterPOJO(&User{}) config.Load() - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") user, err := userProvider.GetUser(context.TODO(), &User{Name: "Alex001"}) diff --git a/registry/servicediscovery/nacos/go-client/cmd/client.go b/registry/servicediscovery/nacos/go-client/cmd/client.go index 5b050ee36..17078ae04 100644 --- a/registry/servicediscovery/nacos/go-client/cmd/client.go +++ b/registry/servicediscovery/nacos/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -43,7 +42,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(5 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/registry/servicediscovery/zookeeper/go-client/cmd/client.go b/registry/servicediscovery/zookeeper/go-client/cmd/client.go index eceb95efd..17078ae04 100644 --- a/registry/servicediscovery/zookeeper/go-client/cmd/client.go +++ b/registry/servicediscovery/zookeeper/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -43,7 +42,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/registry/zookeeper/go-client/cmd/client.go b/registry/zookeeper/go-client/cmd/client.go index 88b7c3999..f3731c236 100644 --- a/registry/zookeeper/go-client/cmd/client.go +++ b/registry/zookeeper/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -44,7 +43,6 @@ func main() { if err := config.Load(config.WithPath(path)); err != nil { panic(err) } - time.Sleep(3 * time.Second) logger.Info("start to test dubbo") req := &api.HelloRequest{ diff --git a/rpc/dubbo/go-client/cmd/client.go b/rpc/dubbo/go-client/cmd/client.go index 832d8ed9c..5100720f2 100644 --- a/rpc/dubbo/go-client/cmd/client.go +++ b/rpc/dubbo/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -48,8 +47,6 @@ func main() { config.Load() - time.Sleep(6 * time.Second) - logger.Infof("\n\ntest") test() } diff --git a/rpc/grpc/go-client/cmd/client.go b/rpc/grpc/go-client/cmd/client.go index afad682b8..0de59740e 100644 --- a/rpc/grpc/go-client/cmd/client.go +++ b/rpc/grpc/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -42,7 +41,6 @@ func init() { // need to setup environment variable "CONF_CONSUMER_FILE_PATH" to "conf/client.yml" before run func main() { config.Load() - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") req := &pb.HelloRequest{ diff --git a/rpc/triple/codec-extension/go-client/cmd/client.go b/rpc/triple/codec-extension/go-client/cmd/client.go index e11ed01c1..87d18aa86 100644 --- a/rpc/triple/codec-extension/go-client/cmd/client.go +++ b/rpc/triple/codec-extension/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -50,7 +49,7 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) + user, err := userProvider.GetUser(context.TODO(), &User{Name: "laurence"}, &User{Name: "laurence2"}, "testName") if err != nil { panic(err) diff --git a/rpc/triple/hessian2/go-client/cmd/client.go b/rpc/triple/hessian2/go-client/cmd/client.go index 5516d1be6..a11de4806 100644 --- a/rpc/triple/hessian2/go-client/cmd/client.go +++ b/rpc/triple/hessian2/go-client/cmd/client.go @@ -21,7 +21,6 @@ import ( "context" "encoding/json" "os" - "time" ) import ( @@ -46,7 +45,6 @@ func init() { // need to setup environment variable "CONF_CONSUMER_FILE_PATH" to "conf/client.yml" before run func main() { config.Load() - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") testNormalService() diff --git a/rpc/triple/msgpack/go-client/cmd/client.go b/rpc/triple/msgpack/go-client/cmd/client.go index a563605bc..183afab31 100644 --- a/rpc/triple/msgpack/go-client/cmd/client.go +++ b/rpc/triple/msgpack/go-client/cmd/client.go @@ -20,7 +20,6 @@ package main import ( "context" "os" - "time" ) import ( @@ -47,7 +46,6 @@ func init() { // need to setup environment variable "CONF_CONSUMER_FILE_PATH" to "conf/client.yml" before run func main() { config.Load() - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") user, err := userProvider.GetUser(context.TODO(), &api.User{Name: "laurence"}) diff --git a/rpc/triple/pb/dubbogo-grpc/go-client/cmd/client.go b/rpc/triple/pb/dubbogo-grpc/go-client/cmd/client.go index 1e2726e8e..288447aea 100644 --- a/rpc/triple/pb/dubbogo-grpc/go-client/cmd/client.go +++ b/rpc/triple/pb/dubbogo-grpc/go-client/cmd/client.go @@ -19,7 +19,6 @@ package main import ( "context" - "time" ) import ( @@ -45,7 +44,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(time.Second * 3) stream() unary() diff --git a/rpc/triple/pb/dubbogo-java/go-client/cmd/client.go b/rpc/triple/pb/dubbogo-java/go-client/cmd/client.go index 6a52f372e..8b76095b8 100644 --- a/rpc/triple/pb/dubbogo-java/go-client/cmd/client.go +++ b/rpc/triple/pb/dubbogo-java/go-client/cmd/client.go @@ -20,7 +20,6 @@ package main import ( "context" "fmt" - "time" ) import ( @@ -45,7 +44,6 @@ func main() { if err := config.Load(); err != nil { panic(err) } - time.Sleep(3 * time.Second) gxlog.CInfo("\n\n\nstart to test dubbo") req := &pb.HelloRequest{ From b286a09fc31a7406d24b7645fd7be8a4da2b6427 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 16:03:20 +0800 Subject: [PATCH 4/7] update dubbogo --- go.mod | 2 +- go.sum | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 6c2a65860..de270c155 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/apache/dubbo-go-samples require ( - dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac + dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b github.com/apache/dubbo-go-hessian2 v1.9.4-0.20210917102639-74a8ece5f3cb github.com/dubbogo/gost v1.11.18 github.com/dubbogo/net v0.0.4 diff --git a/go.sum b/go.sum index c9de73f83..1803f2026 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac h1:fxTXz6ooBaAwNHq46Ov4u8EN5pipmqP55DOVy5mgfQo= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211018042356-267c06efa9ac/go.mod h1:fmHYUVOzshW8zsyicHgAVK6WZRRMkwqHWVkesbsT8ec= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b h1:YJeI894vXsv5GWNxWgdBkX0FgOqmYlF9jRegJTmzarc= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b/go.mod h1:cKkXBkYoY5tzeIIzK/YbuycWzMCw9glf8wR9RJggLcI= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -782,8 +782,9 @@ go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0-alpha.0/go.mod h1:mPcW6aZJukV6Aa81LSKpBjQXTWlXB5r74ymPoSWa3Sw= -go.etcd.io/etcd/api/v3 v3.5.0 h1:GsV3S+OfZEOCNXdtNkBSR7kgLobAa/SO6tCxRa0GAYw= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.1 h1:v28cktvBq+7vGyJXF8G+rWJmj+1XUmMtqcLnH8hDocM= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0 h1:2aQv6F436YnN7I4VbI8PPYrBhu+SmrTaADcf8Mi/6PU= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0-alpha.0 h1:jZepGpOeJATxsbMNBZczDS2jHdK/QVHM1iPe9jURJ8o= From 518a9513e6fa242cc8d1ff2e61bab0f9725625f1 Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 16:15:56 +0800 Subject: [PATCH 5/7] fix: filter integrate test --- go.mod | 4 +-- go.sum | 8 +++--- .../custom/tests/integration/main_test.go | 25 ++----------------- .../tests/integration/userprovider_test.go | 13 ++++------ .../etcd/tests/integration/main_test.go | 4 --- .../tests/integration/userprovider_test.go | 7 +++--- .../nacos/tests/integration/main_test.go | 3 --- .../tests/integration/userprovider_test.go | 2 -- 8 files changed, 16 insertions(+), 50 deletions(-) diff --git a/go.mod b/go.mod index de270c155..3427be3fd 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/apache/dubbo-go-samples require ( - dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b + dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3 github.com/apache/dubbo-go-hessian2 v1.9.4-0.20210917102639-74a8ece5f3cb github.com/dubbogo/gost v1.11.18 github.com/dubbogo/net v0.0.4 - github.com/dubbogo/triple v1.0.7 + github.com/dubbogo/triple v1.0.8 github.com/golang/protobuf v1.5.2 github.com/opentracing/opentracing-go v1.2.0 github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 diff --git a/go.sum b/go.sum index 1803f2026..fd9484b7a 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b h1:YJeI894vXsv5GWNxWgdBkX0FgOqmYlF9jRegJTmzarc= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080029-e2021eaf703b/go.mod h1:cKkXBkYoY5tzeIIzK/YbuycWzMCw9glf8wR9RJggLcI= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3 h1:AXjzVXhr4fgaoLbRTPvkFLAbN8MIislohCE5gP5wPQ0= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3/go.mod h1:vtZY/6buZ1RHI6JVBfbKw7Kp582AjLt+57g1Iyk1EdI= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= @@ -186,8 +186,8 @@ github.com/dubbogo/gost v1.11.18/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZT github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= github.com/dubbogo/net v0.0.4 h1:Rn9aMPZwOiRE22YhtxmDEE3H0Q3cfVRNhuEjNMelJ/8= github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3ujIc= -github.com/dubbogo/triple v1.0.7 h1:rPRtf5QNQO2FqXckMugn8KmQyhXQPZyImrEJ/OKAB7o= -github.com/dubbogo/triple v1.0.7/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= +github.com/dubbogo/triple v1.0.8 h1:M3p2t+Bx6z1RbVMm4GjrZKFpe8Ar0g6J0m/6fYU46tQ= +github.com/dubbogo/triple v1.0.8/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= diff --git a/integrate_test/filter/custom/tests/integration/main_test.go b/integrate_test/filter/custom/tests/integration/main_test.go index 44a14621b..6fba67d7b 100644 --- a/integrate_test/filter/custom/tests/integration/main_test.go +++ b/integrate_test/filter/custom/tests/integration/main_test.go @@ -1,5 +1,3 @@ -// +build integration - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -20,40 +18,21 @@ package integration import ( - "context" + "github.com/apache/dubbo-go-samples/api" "os" "testing" - "time" ) import ( "dubbo.apache.org/dubbo-go/v3/config" _ "dubbo.apache.org/dubbo-go/v3/imports" - - hessian "github.com/apache/dubbo-go-hessian2" ) -var userProvider = &UserProvider{} +var userProvider = &api.GreeterClientImpl{} func TestMain(m *testing.M) { config.SetConsumerService(userProvider) - hessian.RegisterPOJO(&User{}) config.Load() os.Exit(m.Run()) } - -type User struct { - ID string - Name string - Age int32 - Time time.Time -} - -type UserProvider struct { - GetUser func(ctx context.Context, req string) (*User, error) -} - -func (u *User) JavaClassName() string { - return "org.apache.dubbo.User" -} diff --git a/integrate_test/filter/custom/tests/integration/userprovider_test.go b/integrate_test/filter/custom/tests/integration/userprovider_test.go index 858b54632..5006138c8 100644 --- a/integrate_test/filter/custom/tests/integration/userprovider_test.go +++ b/integrate_test/filter/custom/tests/integration/userprovider_test.go @@ -1,5 +1,3 @@ -// +build integration - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -21,6 +19,7 @@ package integration import ( "context" + "github.com/apache/dubbo-go-samples/api" "testing" ) @@ -29,11 +28,9 @@ import ( ) func TestGetUser(t *testing.T) { - user := &User{} - user, err := userProvider.GetUser(context.TODO(), "A001") + user, err := userProvider.SayHello(context.TODO(), &api.HelloRequest{Name: "laurence"}) assert.Nil(t, err) - assert.Equal(t, "A001", user.ID) - assert.Equal(t, "ALEX STOCKS", user.Name) - assert.Equal(t, int32(28), user.Age) - assert.NotNil(t, user.Time) + assert.Equal(t, "12345", user.Id) + assert.Equal(t, "Hello laurence", user.Name) + assert.Equal(t, int32(21), user.Age) } diff --git a/integrate_test/registry/etcd/tests/integration/main_test.go b/integrate_test/registry/etcd/tests/integration/main_test.go index 4975d4546..003b8305b 100644 --- a/integrate_test/registry/etcd/tests/integration/main_test.go +++ b/integrate_test/registry/etcd/tests/integration/main_test.go @@ -1,5 +1,3 @@ -// +build integration - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -22,7 +20,6 @@ package integration import ( "os" "testing" - "time" ) import ( @@ -46,6 +43,5 @@ func TestMain(m *testing.M) { hessian.RegisterPOJO(&pkg.User{}) config.Load() - os.Exit(m.Run()) } diff --git a/integrate_test/registry/etcd/tests/integration/userprovider_test.go b/integrate_test/registry/etcd/tests/integration/userprovider_test.go index 3a18da3da..71556aa74 100644 --- a/integrate_test/registry/etcd/tests/integration/userprovider_test.go +++ b/integrate_test/registry/etcd/tests/integration/userprovider_test.go @@ -1,7 +1,6 @@ -// +build integration - /* - * Licensed to the Apache Software Foundation (ASF) under one or more + * Licensed t// +build integration +o the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 @@ -15,7 +14,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ +*/ package integration diff --git a/integrate_test/registry/nacos/tests/integration/main_test.go b/integrate_test/registry/nacos/tests/integration/main_test.go index 589a882d2..29ad58a62 100644 --- a/integrate_test/registry/nacos/tests/integration/main_test.go +++ b/integrate_test/registry/nacos/tests/integration/main_test.go @@ -1,5 +1,3 @@ -// +build integration - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -40,7 +38,6 @@ func TestMain(m *testing.M) { hessian.RegisterPOJO(&User{}) config.Load() - os.Exit(m.Run()) } diff --git a/integrate_test/registry/nacos/tests/integration/userprovider_test.go b/integrate_test/registry/nacos/tests/integration/userprovider_test.go index 7f17774bb..fbb9061df 100644 --- a/integrate_test/registry/nacos/tests/integration/userprovider_test.go +++ b/integrate_test/registry/nacos/tests/integration/userprovider_test.go @@ -1,5 +1,3 @@ -// +build integration - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with From e3a65815b92b955aef5014c23649de960f34b8bc Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Thu, 21 Oct 2021 16:17:30 +0800 Subject: [PATCH 6/7] fix: license --- .../registry/etcd/tests/integration/userprovider_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integrate_test/registry/etcd/tests/integration/userprovider_test.go b/integrate_test/registry/etcd/tests/integration/userprovider_test.go index 71556aa74..35aff3a8f 100644 --- a/integrate_test/registry/etcd/tests/integration/userprovider_test.go +++ b/integrate_test/registry/etcd/tests/integration/userprovider_test.go @@ -1,6 +1,5 @@ /* - * Licensed t// +build integration -o the Apache Software Foundation (ASF) under one or more + * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 @@ -14,7 +13,7 @@ o the Apache Software Foundation (ASF) under one or more * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. -*/ + */ package integration From 8486101bfd1ea9d0ca24616d9f31350c689869bd Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Mon, 25 Oct 2021 13:59:00 +0800 Subject: [PATCH 7/7] fix: update to latst dubbogo version --- go.mod | 2 +- go.sum | 4 ++-- integrate_test/filter/custom/tests/integration/main_test.go | 5 ++++- .../filter/custom/tests/integration/userprovider_test.go | 5 ++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 3427be3fd..2f989ac27 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/apache/dubbo-go-samples require ( - dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3 + dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211025055545-a15f72aa4fa8 github.com/apache/dubbo-go-hessian2 v1.9.4-0.20210917102639-74a8ece5f3cb github.com/dubbogo/gost v1.11.18 github.com/dubbogo/net v0.0.4 diff --git a/go.sum b/go.sum index fd9484b7a..7a7da9ff7 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3 h1:AXjzVXhr4fgaoLbRTPvkFLAbN8MIislohCE5gP5wPQ0= -dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211021080526-4206fc2035f3/go.mod h1:vtZY/6buZ1RHI6JVBfbKw7Kp582AjLt+57g1Iyk1EdI= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211025055545-a15f72aa4fa8 h1:8yr3rIpMiuTXm61JAWwoBdSJSnx2n4NhUAmEebcVQN4= +dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20211025055545-a15f72aa4fa8/go.mod h1:CNgt1+bui3uWepjoOOi4PVsuf6ZDQZLu0V8sWY02jT0= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= diff --git a/integrate_test/filter/custom/tests/integration/main_test.go b/integrate_test/filter/custom/tests/integration/main_test.go index 6fba67d7b..89b56dfbe 100644 --- a/integrate_test/filter/custom/tests/integration/main_test.go +++ b/integrate_test/filter/custom/tests/integration/main_test.go @@ -18,7 +18,6 @@ package integration import ( - "github.com/apache/dubbo-go-samples/api" "os" "testing" ) @@ -28,6 +27,10 @@ import ( _ "dubbo.apache.org/dubbo-go/v3/imports" ) +import ( + "github.com/apache/dubbo-go-samples/api" +) + var userProvider = &api.GreeterClientImpl{} func TestMain(m *testing.M) { diff --git a/integrate_test/filter/custom/tests/integration/userprovider_test.go b/integrate_test/filter/custom/tests/integration/userprovider_test.go index 5006138c8..5d4eff9ca 100644 --- a/integrate_test/filter/custom/tests/integration/userprovider_test.go +++ b/integrate_test/filter/custom/tests/integration/userprovider_test.go @@ -19,7 +19,6 @@ package integration import ( "context" - "github.com/apache/dubbo-go-samples/api" "testing" ) @@ -27,6 +26,10 @@ import ( "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go-samples/api" +) + func TestGetUser(t *testing.T) { user, err := userProvider.SayHello(context.TODO(), &api.HelloRequest{Name: "laurence"}) assert.Nil(t, err)