From 5e18a151096c2799d164fa6465b9a15654f6170f Mon Sep 17 00:00:00 2001 From: Casper-Mars <50834595+Casper-Mars@users.noreply.github.com> Date: Thu, 24 Feb 2022 23:45:27 +0800 Subject: [PATCH] fix(config/config):fix type not match bug (#1837) If the type of new value not match the old one, value stay the old one. --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 82c198a15..783cc25c1 100644 --- a/config/config.go +++ b/config/config.go @@ -86,7 +86,7 @@ func (c *config) watch(w Watcher) { c.cached.Range(func(key, value interface{}) bool { k := key.(string) v := value.(Value) - if n, ok := c.reader.Value(k); ok && !reflect.DeepEqual(n.Load(), v.Load()) { + if n, ok := c.reader.Value(k); ok && reflect.TypeOf(n.Load()) == reflect.TypeOf(v.Load()) && !reflect.DeepEqual(n.Load(), v.Load()) { v.Store(n.Load()) if o, ok := c.observers.Load(k); ok { o.(Observer)(k, v)