sort result

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2020-07-07 21:27:50 +08:00
parent 3273d62811
commit b48792b094
3 changed files with 31 additions and 31 deletions
+11
View File
@@ -7,6 +7,7 @@ import (
"hack-browser-data/log"
"hack-browser-data/utils"
"os"
"sort"
"github.com/jszwec/csvutil"
)
@@ -143,3 +144,13 @@ func (b BrowserData) OutPutJson(dir, browser, format string) error {
}
return nil
}
func (b BrowserData) Sorted() {
sort.Slice(b.BookmarkSlice, func(i, j int) bool {
return b.BookmarkSlice[i].ID < b.BookmarkSlice[j].ID
})
sort.Slice(b.HistorySlice, func(i, j int) bool {
return b.HistorySlice[i].VisitCount > b.HistorySlice[j].VisitCount
})
sort.Sort(b.LoginDataSlice)
}