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

Function testURL

pkg/app/test_command.go:111–126  ·  view source on GitHub ↗
(url string, filters runtime.Filters)

Source from the content-addressed store, hash-verified

109}
110
111func testURL(url string, filters runtime.Filters) (runtime.Result, error) {
112 resp, err := http.Get(url)
113 if err != nil {
114 return runtime.Result{}, err
115 }
116 defer resp.Body.Close()
117
118 body, err := ioutil.ReadAll(resp.Body)
119 if err != nil {
120 return runtime.Result{}, err
121 }
122
123 s := suite.ParseYAML(body, "")
124
125 return execute(s, filters)
126}
127
128func isURL(s string) bool {
129 return strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://")

Callers 1

TestCommandFunction · 0.85

Calls 2

ParseYAMLFunction · 0.92
executeFunction · 0.85

Tested by 1

TestCommandFunction · 0.68