From 2d5cd62d650e55bc067897ef16cfbf63786bcc9a Mon Sep 17 00:00:00 2001 From: bel Date: Wed, 12 Apr 2023 15:26:11 -0600 Subject: [PATCH] bolt put nil is del --- bolt.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bolt.go b/bolt.go index ee18c79..5a0543d 100755 --- a/bolt.go +++ b/bolt.go @@ -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) }) }