Skip to content

Commit

Permalink
fix: 🐛 SaveJson bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
panicdragon committed Nov 19, 2021
1 parent 8ace0a1 commit 5ca1b17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/save/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ func SaveHostingFile(url string) error {
func SaveJson(js *simplejson.Json) error {
if len(js.MustMap()) > 0 {
if len(js.Get("name").MustString()) > 0 {
return Start("", js.Get("name").MustString(), js.Get("url").MustString())
Start("", js.Get("name").MustString(), js.Get("url").MustString())
} else {
for key, _ := range js.MustMap() {
for i, _ := range js.Get(key).MustArray() {
return Start(key, js.Get(key).GetIndex(i).Get("name").MustString(), js.Get(key).GetIndex(i).Get("url").MustString())
Start(key, js.Get(key).GetIndex(i).Get("name").MustString(), js.Get(key).GetIndex(i).Get("url").MustString())
}
}
}
} else if len(js.MustArray()) > 0 {
for i, _ := range js.MustArray() {
return Start("", js.GetIndex(i).Get("name").MustString(), js.GetIndex(i).Get("url").MustString())
Start("", js.GetIndex(i).Get("name").MustString(), js.GetIndex(i).Get("url").MustString())
}
}
return nil
Expand Down

0 comments on commit 5ca1b17

Please sign in to comment.