From 58cd0f660f4ce2b5609411353e94d5b21c0c019c Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Fri, 10 Apr 2020 17:41:10 +0100 Subject: [PATCH] move reg util to own package (#1523) * move reg util to own package * fix test * fix broken static router --- cache.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cache.go b/cache.go index eb12d16..7714f98 100644 --- a/cache.go +++ b/cache.go @@ -9,6 +9,7 @@ import ( "github.com/micro/go-micro/v2/logger" "github.com/micro/go-micro/v2/registry" + util "github.com/micro/go-micro/v2/util/registry" ) // Cache is the registry cache interface @@ -119,7 +120,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) { // get cache ttl ttl := c.ttls[service] // make a copy - cp := registry.Copy(services) + cp := util.Copy(services) // got services && within ttl so return cache if c.isValid(cp, ttl) { @@ -152,7 +153,7 @@ func (c *cache) get(service string) ([]*registry.Service, error) { // cache results c.Lock() - c.set(service, registry.Copy(services)) + c.set(service, util.Copy(services)) c.Unlock() return services, nil