diff --git a/grpc.go b/grpc.go index 9b66428..ef61308 100644 --- a/grpc.go +++ b/grpc.go @@ -582,7 +582,7 @@ func (g *grpcServer) Register() error { return subscriberList[i].topic > subscriberList[j].topic }) - var endpoints []*registry.Endpoint + endpoints := make([]*registry.Endpoint, 0, len(handlerList)+len(subscriberList)) for _, n := range handlerList { endpoints = append(endpoints, g.handlers[n].Endpoints()...) }