refactor: Optimize traversal browser data logic (#311)

* refactor: Refactor package names and imports for better code organization.
* refactor: Package imports and variable types for consistency
* chore: Disable unused-parameter rule in revive.
* refactor: Refactor and organize data extraction and browserdata parse.
* fix: rename wrong error message info
This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2024-04-12 19:10:41 +08:00
parent c31cf602ed
commit 536f2082f9
35 changed files with 449 additions and 353 deletions
+3 -3
View File
@@ -64,10 +64,10 @@ func CopyFile(src, dst string) error {
return nil
}
// ItemName returns the filename from the provided path
func ItemName(browser, item, ext string) string {
// Filename returns the filename from the provided path
func Filename(browser, dataType, ext string) string {
replace := strings.NewReplacer(" ", "_", ".", "_", "-", "_")
return strings.ToLower(fmt.Sprintf("%s_%s.%s", replace.Replace(browser), item, ext))
return strings.ToLower(fmt.Sprintf("%s_%s.%s", replace.Replace(browser), dataType, ext))
}
func BrowserName(browser, user string) string {