mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-29 20:10:56 -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
|
return
|
||||||
}
|
}
|
||||||
var structMap map[string]interface{}
|
var structMap map[string]interface{}
|
||||||
inrec, _ := json2.Marshal(cfg)
|
inrec, err := json2.Marshal(cfg)
|
||||||
_ = json2.Unmarshal(inrec, &structMap)
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = json2.Unmarshal(inrec, &structMap)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
// remove empty structs
|
// remove empty structs
|
||||||
for k, v := range structMap {
|
for k, v := range structMap {
|
||||||
if smap, OK := v.(map[string]interface{}); OK && len(smap) == 0 {
|
if smap, OK := v.(map[string]interface{}); OK && len(smap) == 0 {
|
||||||
|
|
Loading…
Reference in a new issue