This commit is contained in:
@@ -40,15 +40,7 @@ func (ds *DiskStorage) Put(key string, data []byte) error {
|
||||
if err := ds.ensureDir(); err != nil {
|
||||
return err
|
||||
}
|
||||
f, err := os.Open(path.Join(ds.dir, key))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = f.Write(data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return f.Close()
|
||||
return os.WriteFile(path.Join(ds.dir, key), data, 0644)
|
||||
}
|
||||
|
||||
func (ds *DiskStorage) Delete(key string) error {
|
||||
|
||||
Reference in New Issue
Block a user