func (store *BoltStore) Del(uri string) error { namespace, key := util.NamespaceKey(uri) bucketkeys := util.PathFolders(namespace) var bucket *bolt.Bucket = nil var err error e := store.db.Update(func(tx *bolt.Tx) error { for _, bucketkey := range bucketkeys { if bucket == nil { bucket, err = tx.CreateBucketIfNotExists([]byte(bucketkey)) if err != nil { return err } } else { bucket, err = bucket.CreateBucketIfNotExists([]byte(bucketkey)) if err != nil { return err } } } bucket.DeleteBucket([]byte(key)) bucket.Delete([]byte(key)) return nil }) return e }