bolt put nil is del

This commit is contained in:
bel
2023-04-12 15:26:11 -06:00
parent 01db198192
commit 2d5cd62d65

View File

@@ -60,6 +60,9 @@ func (b *Bolt) Set(key string, value []byte, ns ...string) error {
if err != nil {
return err
}
if value == nil {
return bkt.Delete(key)
}
return bkt.Put([]byte(key), value)
})
}