cli stuff

This commit is contained in:
Bel LaPointe
2020-07-30 15:54:38 -06:00
parent 4115b7b603
commit 5b57d3f6ea
3 changed files with 11 additions and 4 deletions

View File

@@ -59,7 +59,11 @@ func (b *Files) Set(key string, value []byte, ns ...string) error {
namespace := resolveNamespace(ns)
dir := path.Join(b.root, namespace)
if value == nil {
return os.Remove(path.Join(dir, key))
err := os.Remove(path.Join(dir, key))
if os.IsNotExist(err) {
err = nil
}
return err
}
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
return err