move reg util to own package (#1523)

* move reg util to own package

* fix test

* fix broken static router
This commit is contained in:
Asim Aslam 2020-04-10 17:41:10 +01:00 committed by Vasiliy Tolstov
parent e32ca852e0
commit c13f8bd021

View File

@ -16,6 +16,7 @@ import (
"github.com/micro/go-micro/v2/logger" "github.com/micro/go-micro/v2/logger"
"github.com/micro/go-micro/v2/metadata" "github.com/micro/go-micro/v2/metadata"
"github.com/micro/go-micro/v2/registry" "github.com/micro/go-micro/v2/registry"
util "github.com/micro/go-micro/v2/util/registry"
) )
type endpoint struct { type endpoint struct {
@ -164,7 +165,7 @@ func (r *staticRouter) Endpoint(req *http.Request) (*api.Service, error) {
// hack for stream endpoint // hack for stream endpoint
if ep.apiep.Stream { if ep.apiep.Stream {
svcs := registry.Copy(services) svcs := util.Copy(services)
for _, svc := range svcs { for _, svc := range svcs {
if len(svc.Endpoints) == 0 { if len(svc.Endpoints) == 0 {
e := &registry.Endpoint{} e := &registry.Endpoint{}