helper which gives paths to all files in the given directory non-recursively
(path string)
| 7 | |
| 8 | // helper which gives paths to all files in the given directory non-recursively |
| 9 | func listFilesAtPath(path string) ([]string, error) { |
| 10 | filePaths := make([]string, 0) |
| 11 | files, err := os.ReadDir(path) |
| 12 | if err != nil { |
| 13 | return nil, err |
| 14 | } |
| 15 | for _, file := range files { |
| 16 | if !file.IsDir() { |
| 17 | filePaths = append(filePaths, filepath.Join(path, file.Name())) |
| 18 | } |
| 19 | } |
| 20 | return filePaths, nil |
| 21 | } |
searching dependent graphs…