1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-08-10 21:52:01 +02:00

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 GitHub
parent 4fd12430d0
commit e5268dd0a6
4 changed files with 38 additions and 30 deletions

View File

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