bolt put nil is del

master
bel 2023-04-12 15:26:11 -06:00
parent 01db198192
commit 2d5cd62d65
1 changed files with 3 additions and 0 deletions

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)
})
}