mirror of https://github.com/golang/go.git
io: add error check to TeeReader Example
Change-Id: I0b94bdced47483c6412e9979ce2d103fbfc52afb Reviewed-on: https://go-review.googlesource.com/c/go/+/353729 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Carlos Amedee <carlos@golang.org>
This commit is contained in:
parent
84277bfd07
commit
8ce1a953fb
|
|
@ -142,7 +142,9 @@ func ExampleTeeReader() {
|
|||
r = io.TeeReader(r, os.Stdout)
|
||||
|
||||
// Everything read from r will be copied to stdout.
|
||||
io.ReadAll(r)
|
||||
if _, err := io.ReadAll(r); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// some io.Reader stream to be read
|
||||
|
|
|
|||
Loading…
Reference in New Issue