ooni-probe-cli/internal/iox/example_test.go

22 lines
331 B
Go
Raw Normal View History

package iox_test
import (
"context"
"fmt"
"log"
"strings"
"github.com/ooni/probe-cli/v3/internal/iox"
)
func ExampleReadAllContext() {
r := strings.NewReader("deadbeef")
ctx := context.Background()
out, err := iox.ReadAllContext(ctx, r)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%d\n", len(out))
// Output: 8
}