mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
docs: add key function documents
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -16,38 +15,6 @@ import (
|
||||
|
||||
const Prefix = "[x]: "
|
||||
|
||||
func CopyDB(src, dst string) error {
|
||||
locals, _ := filepath.Glob("*")
|
||||
for _, v := range locals {
|
||||
if v == dst {
|
||||
err := os.Remove(dst)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
sourceFile, err := ioutil.ReadFile(src)
|
||||
if err != nil {
|
||||
log.Debug(err.Error())
|
||||
}
|
||||
err = ioutil.WriteFile(dst, sourceFile, 0777)
|
||||
if err != nil {
|
||||
log.Debug(err.Error())
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func GetItemPath(profilePath, file string) (string, error) {
|
||||
p, err := filepath.Glob(profilePath + file)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(p) > 0 {
|
||||
return p[0], nil
|
||||
}
|
||||
return "", fmt.Errorf("find %s failed", file)
|
||||
}
|
||||
|
||||
func IntToBool(a int) bool {
|
||||
switch a {
|
||||
case 0, -1:
|
||||
|
||||
Reference in New Issue
Block a user