Removed S3

This commit is contained in:
2024-09-08 23:42:36 -06:00
parent c0923aaf2b
commit 2edff6915a
15 changed files with 51 additions and 203 deletions

33
lib/files.go Normal file
View File

@ -0,0 +1,33 @@
package lib
import (
"os"
"path/filepath"
)
// ListFiles returns a slice of file paths in the given directory
func ListFiles(dir string) ([]string, error) {
var filePaths []string
entries, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
for _, entry := range entries {
if entry.IsDir() {
// Recursively list files in subdirectories
subDir := filepath.Join(dir, entry.Name())
subFiles, err := ListFiles(subDir)
if err != nil {
return nil, err
}
filePaths = append(filePaths, subFiles...)
} else {
// Add file path to the slice
filePath := filepath.Join(dir, entry.Name())
filePaths = append(filePaths, filePath)
}
}
return filePaths, nil
}