mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
refactor: do not silence errors on config sync
This commit is contained in:
parent
0ec78b991c
commit
c8068b9cb1
|
@ -133,8 +133,14 @@ func (cfg *Config) sync() {
|
|||
return
|
||||
}
|
||||
var structMap map[string]interface{}
|
||||
inrec, _ := json2.Marshal(cfg)
|
||||
_ = json2.Unmarshal(inrec, &structMap)
|
||||
inrec, err := json2.Marshal(cfg)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = json2.Unmarshal(inrec, &structMap)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// remove empty structs
|
||||
for k, v := range structMap {
|
||||
if smap, OK := v.(map[string]interface{}); OK && len(smap) == 0 {
|
||||
|
|
Loading…
Reference in a new issue