diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-12-25 12:16:40 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-12-25 12:17:05 -0500 |
| commit | f26c564dcadf71e7c4c8fe99555fb7d038216140 (patch) | |
| tree | 7e8692276f30d96539310ad2a4a274eb4ae8b8ea /steam/filelisting.go | |
| parent | 40bf960edf568a65cf49d295fde946518bcf20fd (diff) | |
| download | steam-export-f26c564dcadf71e7c4c8fe99555fb7d038216140.tar.gz steam-export-f26c564dcadf71e7c4c8fe99555fb7d038216140.tar.xz | |
Flush the tarwriter before we return
Diffstat (limited to 'steam/filelisting.go')
| -rw-r--r-- | steam/filelisting.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/steam/filelisting.go b/steam/filelisting.go new file mode 100644 index 0000000..f94319e --- /dev/null +++ b/steam/filelisting.go @@ -0,0 +1,26 @@ +package steam + +import ( + "path/filepath" + "os" +) + +func fileListing(pth string) (map[string]struct{}, error) { + out := map[string]struct{}{} + err := filepath.Walk(pth, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + if info.Mode().IsRegular() { + out[path] = struct{}{} + } + + return nil + }) + if err != nil { + return nil, err + } + + return out, nil +} |
