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

Function ExamplePipe_Get

script_test.go:2427–2439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2425}
2426
2427func ExamplePipe_Get() {
2428 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
2429 data, err := io.ReadAll(r.Body)
2430 if err != nil {
2431 log.Fatal(err)
2432 }
2433 fmt.Fprintf(w, "You said: %s", data)
2434 }))
2435 defer ts.Close()
2436 script.Echo("hello").Get(ts.URL).Stdout()
2437 // Output:
2438 // You said: hello
2439}
2440
2441func ExamplePipe_Hash() {
2442 sum, err := script.Echo("hello world").Hash(sha512.New())

Callers

nothing calls this directly

Calls 4

EchoFunction · 0.92
StdoutMethod · 0.80
GetMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…