etcd: allow readwrite bucket Delete with nil key (bbolt compatibility)
This commit is contained in:
parent
e8f47cf882
commit
adfd99ec08
@ -290,6 +290,9 @@ func (b *readWriteBucket) Put(key, value []byte) error {
|
|||||||
// Delete deletes the key/value pointed to by the passed key.
|
// Delete deletes the key/value pointed to by the passed key.
|
||||||
// Returns ErrKeyRequred if the passed key is empty.
|
// Returns ErrKeyRequred if the passed key is empty.
|
||||||
func (b *readWriteBucket) Delete(key []byte) error {
|
func (b *readWriteBucket) Delete(key []byte) error {
|
||||||
|
if key == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if len(key) == 0 {
|
if len(key) == 0 {
|
||||||
return walletdb.ErrKeyRequired
|
return walletdb.ErrKeyRequired
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user