refactor: replace util with go generics

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-04-17 16:35:40 +08:00
parent a0eeee8604
commit 806c5bf2ee
14 changed files with 83 additions and 113 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ import (
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils"
"hack-browser-data/internal/utils/typeutil"
)
type ChromiumHistory []history
@@ -40,7 +40,7 @@ func (c *ChromiumHistory) Parse(masterKey []byte) error {
Url: url,
Title: title,
VisitCount: visitCount,
LastVisitTime: utils.TimeEpochFormat(lastVisitTime),
LastVisitTime: typeutil.TimeEpoch(lastVisitTime),
}
*c = append(*c, data)
}
@@ -91,7 +91,7 @@ func (f *FirefoxHistory) Parse(masterKey []byte) error {
Title: title,
Url: url,
VisitCount: visitCount,
LastVisitTime: utils.TimeStampFormat(visitDate / 1000000),
LastVisitTime: typeutil.TimeStamp(visitDate / 1000000),
})
}
sort.Slice(*f, func(i, j int) bool {