Fix GetByte

This commit is contained in:
Brian Buller 2021-04-06 16:41:36 -05:00
parent f4e5a5e71c
commit 2b96cfe1b6

View File

@ -122,6 +122,9 @@ func (b *DB) GetBytes(path []string, key string) ([]byte, error) {
} }
// newBkt should have the last bucket in the path // newBkt should have the last bucket in the path
val := bkt.Get([]byte(key)) val := bkt.Get([]byte(key))
if val == nil {
return fmt.Errorf("Couldn't find value")
}
ret = make([]byte, len(val)) ret = make([]byte, len(val))
copy(ret, val) copy(ret, val)
return nil return nil