Fixed bug in get bucket list method
This commit is contained in:
parent
ea0e080045
commit
50a16b9056
@ -232,16 +232,14 @@ func (b *DB) GetBucketList(path []string) ([]string, error) {
|
|||||||
if bkt == nil {
|
if bkt == nil {
|
||||||
return fmt.Errorf("Couldn't find bucket " + path[0])
|
return fmt.Errorf("Couldn't find bucket " + path[0])
|
||||||
}
|
}
|
||||||
var newBkt *bolt.Bucket
|
|
||||||
var berr error
|
var berr error
|
||||||
if len(path) > 1 {
|
if len(path) > 1 {
|
||||||
for idx := 1; idx < len(path); idx++ {
|
for idx := 1; idx < len(path); idx++ {
|
||||||
newBkt = bkt.Bucket([]byte(path[idx]))
|
bkt = bkt.Bucket([]byte(path[idx]))
|
||||||
if newBkt == nil {
|
if bkt == nil {
|
||||||
return fmt.Errorf("Couldn't find bucket " + strings.Join(path[:idx], "/"))
|
return fmt.Errorf("Couldn't find bucket " + strings.Join(path[:idx], " / "))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bkt = newBkt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newBkt should have the last bucket in the path
|
// newBkt should have the last bucket in the path
|
||||||
|
Loading…
Reference in New Issue
Block a user