MCPcopy Create free account
hub / github.com/commander-cli/commander / testDir

Function testDir

pkg/app/test_command.go:87–109  ·  view source on GitHub ↗
(directory string, filters runtime.Filters)

Source from the content-addressed store, hash-verified

85}
86
87func testDir(directory string, filters runtime.Filters) (runtime.Result, error) {
88 result := runtime.Result{}
89 files, err := ioutil.ReadDir(directory)
90 if err != nil {
91 return result, fmt.Errorf("Error: Input is not a directory")
92 }
93
94 for _, f := range files {
95 if f.IsDir() {
96 continue // skip dirs
97 }
98
99 p := path.Join(directory, f.Name())
100 newResult, err := testFile(p, f.Name(), filters)
101 if err != nil {
102 return result, err
103 }
104
105 result = convergeResults(result, newResult)
106 }
107
108 return result, nil
109}
110
111func testURL(url string, filters runtime.Filters) (runtime.Result, error) {
112 resp, err := http.Get(url)

Callers 1

TestCommandFunction · 0.85

Calls 2

testFileFunction · 0.85
convergeResultsFunction · 0.85

Tested by 1

TestCommandFunction · 0.68