cli stuff
This commit is contained in:
6
files.go
6
files.go
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user