From 6ff86118fe91371ee98b41cf7d7102a6b9c89775 Mon Sep 17 00:00:00 2001 From: Nicolas JUHEL Date: Wed, 2 Nov 2022 14:52:44 +0100 Subject: [PATCH] Package Config: fix bug with delete component list key --- config/cptList.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/cptList.go b/config/cptList.go index 5b04a66b..cb767edd 100644 --- a/config/cptList.go +++ b/config/cptList.go @@ -164,11 +164,7 @@ func (c *componentList) ComponentDel(key string) { c.l = make(map[string]*atomic.Value, 0) } - if v := c.l[key]; v == nil { - return - } else { - c.l[key] = new(atomic.Value) - } + delete(c.l, key) } func (c *componentList) ComponentSet(key string, cpt Component) {