summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
Diffstat (limited to 'find.go')
-rw-r--r--find.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/find.go b/find.go
new file mode 100644
index 0000000..31e581c
--- /dev/null
+++ b/find.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "os"
+ "path/filepath"
+)
+
+func FindFiles(lookhere string) ([]string, error) {
+ var allfiles []string
+
+ err := filepath.Walk(lookhere, func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+
+ if !info.IsDir() {
+ allfiles = append(allfiles, path)
+ }
+ return nil
+ })
+
+ return allfiles, err
+}