This commit is contained in:
Jay 2020-04-20 10:03:22 +08:00
parent aa68871e8d
commit c726a94227

View File

@ -26,7 +26,10 @@ func SetRoutes(e *gin.Engine) {
var list []string = make([]string, 0)
db := database.Get()
err := db.View(func(tx *bbolt.Tx) error {
bucket := tx.Bucket([]byte("led"))
bucket, err := tx.CreateBucketIfNotExists([]byte("led"))
if err != nil {
return err
}
if b := bucket.Get([]byte("project")); b == nil {
return nil
} else {