This commit is contained in:
cdle
2021-10-19 22:43:05 +08:00
parent 852665999e
commit e797ce1c74
10 changed files with 35 additions and 20 deletions
+6 -4
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"reflect"
"runtime"
"strconv"
"github.com/boltdb/bolt"
@@ -23,11 +24,12 @@ func NewBucket(name string) Bucket {
}
func initStore() {
// if _, err := os.Stat(ExecPath + "/sillyGirl.cache"); err == nil {
// os.Rename(ExecPath+"/sillyGirl.cache", "/etc/sillyGirl/sillyGirl.cache")
// }
var err error
db, err = bolt.Open("/etc/sillyGirl/sillyGirl.cache", 0600, nil)
if runtime.GOOS != "windows" {
db, err = bolt.Open("/etc/sillyGirl/sillyGirl.cache", 0600, nil)
} else {
db, err = bolt.Open(`C:\ProgramData\sillyGirl.cache`, 0600, nil)
}
if err != nil {
panic(err)
}