MCPcopy
hub / github.com/bitfield/script / ExampleGet

Function ExampleGet

script_test.go:2226–2234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2224}
2225
2226func ExampleGet() {
2227 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2228 fmt.Fprintln(w, "some data")
2229 }))
2230 defer ts.Close()
2231 script.Get(ts.URL).Stdout()
2232 // Output:
2233 // some data
2234}
2235
2236func ExampleIfExists_true() {
2237 script.IfExists("./testdata/hello.txt").Echo("found it").Stdout()

Callers

nothing calls this directly

Calls 3

GetFunction · 0.92
StdoutMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…