()
| 2224 | } |
| 2225 | |
| 2226 | func 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 | |
| 2236 | func ExampleIfExists_true() { |
| 2237 | script.IfExists("./testdata/hello.txt").Echo("found it").Stdout() |