From fae8c5eb4c089f3af97d5fca7f0a2ed41247cfc7 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Wed, 19 Dec 2018 09:27:53 +0000 Subject: [PATCH] fix context --- registry/gossip/gossip.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/registry/gossip/gossip.go b/registry/gossip/gossip.go index de2c66dd..a48ac0ca 100644 --- a/registry/gossip/gossip.go +++ b/registry/gossip/gossip.go @@ -571,16 +571,14 @@ func (g *gossipRegistry) String() string { func NewRegistry(opts ...registry.Option) registry.Registry { gossip := &gossipRegistry{ - options: registry.Options{}, + options: registry.Options{ + Context: context.Background(), + }, updates: make(chan *update, 100), services: make(map[string][]*registry.Service), watchers: make(map[string]chan *registry.Result), } - if gossip.options.Context == nil { - gossip.options.Context = context.Background() - } - // configure the gossiper if err := configure(gossip, opts...); err != nil { log.Fatalf("Error configuring registry: %v", err)