From 60549cfa09d4f080a1ae6d9f7d0c7f02237a7140 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 20 Dec 2018 23:49:15 +0000 Subject: [PATCH] Adds special keyword 'hide' for masking built-in nodeinfo defaults --- src/yggdrasil/nodeinfo.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/nodeinfo.go b/src/yggdrasil/nodeinfo.go index f525beca..5e71a6e1 100644 --- a/src/yggdrasil/nodeinfo.go +++ b/src/yggdrasil/nodeinfo.go @@ -108,9 +108,14 @@ func (m *nodeinfo) setNodeInfo(given interface{}) error { if nodeinfomap, ok := given.(map[string]interface{}); ok { for key, value := range nodeinfomap { if _, ok := newnodeinfo[key]; ok { + if value == "hide" { + delete(newnodeinfo, key) + } continue } - newnodeinfo[key] = value + if value != "hide" { + newnodeinfo[key] = value + } } } if newjson, err := json.Marshal(newnodeinfo); err == nil {