apikey
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 32s

This commit is contained in:
matst80
2025-05-15 19:47:49 +02:00
parent 8715c7ea34
commit fa47d75541
2 changed files with 10 additions and 11 deletions

View File

@@ -19,10 +19,7 @@ func NewDiskStorage(ids []string) (Storage, error) {
idPth := path.Join(ids...)
dir := path.Join(pth, idPth)
s := &DiskStorage{dir: dir}
err := s.ensureDir()
if err != nil {
return nil, err
}
return s, nil
}
@@ -32,9 +29,6 @@ func (ds *DiskStorage) ensureDir() error {
}
func (ds *DiskStorage) Get(key string) (io.Reader, error) {
if err := ds.ensureDir(); err != nil {
return nil, err
}
f, err := os.Open(path.Join(ds.dir, key))
if err != nil {
return nil, err
@@ -63,9 +57,6 @@ func (ds *DiskStorage) Delete(key string) error {
}
func (ds *DiskStorage) List(prefix string) ([]string, error) {
if err := ds.ensureDir(); err != nil {
return nil, err
}
data, err := os.ReadDir(path.Join(ds.dir, prefix))
if err != nil {
return nil, err