mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-22 07:57:31 +00:00
Adds special keyword 'hide' for masking built-in nodeinfo defaults
This commit is contained in:
parent
e65910806c
commit
60549cfa09
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user