From f26c564dcadf71e7c4c8fe99555fb7d038216140 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Fri, 25 Dec 2020 12:16:40 -0500 Subject: Flush the tarwriter before we return --- steam/filelisting.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 steam/filelisting.go (limited to 'steam/filelisting.go') 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 +} -- cgit v1.2.3