From d0bc3d0d3b59014ee68a5d26d7cf3cf6e06d3249 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 20 Apr 2021 12:55:27 +0300 Subject: [PATCH] update for latest micro Signed-off-by: Vasiliy Tolstov --- go.mod | 6 ++---- go.sum | 4 ++-- grpc.go | 10 +++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index bba1e53..4d3b543 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,12 @@ module github.com/unistack-org/micro-server-grpc/v3 -go 1.15 +go 1.16 require ( github.com/golang/protobuf v1.5.2 - github.com/unistack-org/micro/v3 v3.3.15 + github.com/unistack-org/micro/v3 v3.3.16 golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/grpc v1.37.0 google.golang.org/protobuf v1.26.0 ) - -//replace github.com/unistack-org/micro/v3 => ../../micro diff --git a/go.sum b/go.sum index cc5a67d..67b9968 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/silas/dag v0.0.0-20210121180416-41cf55125c34/go.mod h1:7RTUFBdIRC9nZ7/3RyRNH1bdqIShrDejd1YbLwgPS+I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/unistack-org/micro/v3 v3.3.15 h1:rj+spzhezCg4gmj1nuF0FRGixC51/7xFACOchB/23/E= -github.com/unistack-org/micro/v3 v3.3.15/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo= +github.com/unistack-org/micro/v3 v3.3.16 h1:v0h/oC0TO2n1djQJeOjD2jNEqKkiykwI6cpflEVTlQE= +github.com/unistack-org/micro/v3 v3.3.16/go.mod h1:ETGcQQUcjxGaD44LUMX+0fgo8Loh7ExldfIPLvfUmDo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/grpc.go b/grpc.go index a4a267c..9482039 100644 --- a/grpc.go +++ b/grpc.go @@ -636,11 +636,9 @@ func (g *grpcServer) Register() error { g.RLock() // Maps are ordered randomly, sort the keys for consistency var handlerList []string - for n, e := range g.handlers { + for n, _ := range g.handlers { // Only advertise non internal handlers - if !e.Options().Internal { - handlerList = append(handlerList, n) - } + handlerList = append(handlerList, n) } sort.Strings(handlerList) @@ -648,9 +646,7 @@ func (g *grpcServer) Register() error { var subscriberList []*subscriber for e := range g.subscribers { // Only advertise non internal subscribers - if !e.Options().Internal { - subscriberList = append(subscriberList, e) - } + subscriberList = append(subscriberList, e) } sort.Slice(subscriberList, func(i, j int) bool { return subscriberList[i].topic > subscriberList[j].topic