From 29e632a5b14c4213cbecaf7306388c21f97809e9 Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Wed, 15 Sep 2021 17:58:14 +0800 Subject: [PATCH] update --- core/store.go | 10 +++++++++- core/test.go | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/store.go b/core/store.go index b24a1e7..da09bb6 100644 --- a/core/store.go +++ b/core/store.go @@ -4,11 +4,19 @@ import ( "github.com/boltdb/bolt" ) -var sillyGirl Bucket = "sillyGirl" +var sillyGirl Bucket = NewBucket("sillyGirl") var db *bolt.DB type Bucket string +var Buckets = []Bucket{} + +func NewBucket(name string) Bucket { + b := Bucket(name) + Buckets = append(Buckets) + return b +} + func init() { var err error db, err = bolt.Open(ExecPath+"/sillyGirl.cache", 0600, nil) diff --git a/core/test.go b/core/test.go index 09086ef..333a8e3 100644 --- a/core/test.go +++ b/core/test.go @@ -6,8 +6,6 @@ import ( "github.com/cdle/sillyGirl/im" ) -var Buckets = []Bucket{sillyGirl} - func init() { AddCommand("", []Function{ {