This commit is contained in:
YouROK
2020-11-30 23:32:51 +03:00
parent 0569ade7b8
commit ee7902cbb6
5 changed files with 13 additions and 12 deletions

View File

@@ -14,8 +14,8 @@ type TDB struct {
db *bolt.DB
}
func NewTDB(path string, readOnly bool) *TDB {
db, err := bolt.Open(filepath.Join(path, "config.db"), 0666, nil)
func NewTDB(readOnly bool) *TDB {
db, err := bolt.Open(filepath.Join(Path, "config.db"), 0666, nil)
if err != nil {
log.TLogln(err)
return nil
@@ -23,7 +23,7 @@ func NewTDB(path string, readOnly bool) *TDB {
tdb := new(TDB)
tdb.db = db
tdb.Path = path
tdb.Path = Path
tdb.ReadOnly = readOnly
return tdb
}

View File

@@ -5,9 +5,8 @@ var (
Path string
)
func InitSets(path string, readOnly bool) {
Path = path
tdb = NewTDB(path, readOnly)
func InitSets(readOnly bool) {
tdb = NewTDB(readOnly)
loadBTSets()
}