From 8e52761edb494d245fd80c2ef7c6a1d1c408f833 Mon Sep 17 00:00:00 2001 From: isfk <70327450+isfk@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:31:48 +0800 Subject: [PATCH] fix context value nil (#2391) --- plugins/registry/nacos/nacos.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/registry/nacos/nacos.go b/plugins/registry/nacos/nacos.go index 27b83909..31b143a9 100644 --- a/plugins/registry/nacos/nacos.go +++ b/plugins/registry/nacos/nacos.go @@ -1,6 +1,7 @@ package nacos import ( + "context" "errors" "fmt" "net" @@ -27,7 +28,9 @@ func init() { // NewRegistry NewRegistry func NewRegistry(opts ...registry.Option) registry.Registry { n := &nacosRegistry{ - opts: registry.Options{}, + opts: registry.Options{ + Context: context.Background(), + }, } if err := configure(n, opts...); err != nil { panic(err)