aboutsummaryrefslogtreecommitdiff
path: root/src/io/example_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2022-06-03 16:00:16 -0400
committerGopher Robot <gobot@golang.org>2022-06-04 14:00:38 +0000
commitf8a53df314e4af8cd350eedb0dae77d4c4fc30d0 (patch)
tree87799bdeda270fe74bc07380d57c94b9ea60b07f /src/io/example_test.go
parent21f05284c79c3e823169c62d189826f735006d43 (diff)
downloadgo-f8a53df314e4af8cd350eedb0dae77d4c4fc30d0.tar.xz
io: revert: add an Err field to LimitedReader
We are having a hard time deciding the exact semantics of the Err field, and we need to ship the beta. So revert the Err field change; it can wait for Go 1.20. For #51115. This reverts CL 396215. Change-Id: I7719386567d3da10a614058a11f19dbccf304b4d Reviewed-on: https://go-review.googlesource.com/c/go/+/410133 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/io/example_test.go')
-rw-r--r--src/io/example_test.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/io/example_test.go b/src/io/example_test.go
index e4b20bd981..419e449982 100644
--- a/src/io/example_test.go
+++ b/src/io/example_test.go
@@ -6,7 +6,6 @@ package io_test
import (
"bytes"
- "errors"
"fmt"
"io"
"log"
@@ -284,16 +283,3 @@ func ExampleReadAll() {
// Output:
// Go is a general-purpose language designed with systems programming in mind.
}
-
-func ExampleLimitedReader() {
- r := strings.NewReader("some io.Reader stream to be read\n")
- sentinel := errors.New("reached read limit")
- lr := &io.LimitedReader{R: r, N: 4, Err: sentinel}
-
- if _, err := io.Copy(os.Stdout, lr); err != sentinel {
- log.Fatal(err)
- }
-
- // Output:
- // some
-}