]> Cypherpunks repositories - gostls13.git/commitdiff
io: add a new ReadSeekCloser interface
authorMohamed Attahri <mohamed@attahri.com>
Tue, 13 Oct 2020 02:26:19 +0000 (02:26 +0000)
committerIan Lance Taylor <iant@golang.org>
Wed, 14 Oct 2020 17:05:21 +0000 (17:05 +0000)
Research showed that this interface is defined frequently enough in
real-world usage to justify its addition to the standard library.

Fixes #40962

Change-Id: I522fe8f9b8753c3fa42ccc1def49611cf88cd340
GitHub-Last-Rev: 6a45be66b42e482a06d9809d9da20c195380988b
GitHub-Pull-Request: golang/go#41939
Reviewed-on: https://go-review.googlesource.com/c/go/+/261577
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>

src/io/io.go

index 87ebe8c1475d7437730dd6f889bda5abf4400de3..4bd1ae913af94036c6f18cf7fa9486d8b9ca3702 100644 (file)
@@ -152,6 +152,14 @@ type ReadSeeker interface {
        Seeker
 }
 
+// ReadSeekCloser is the interface that groups the basic Read, Seek and Close
+// methods.
+type ReadSeekCloser interface {
+       Reader
+       Seeker
+       Closer
+}
+
 // WriteSeeker is the interface that groups the basic Write and Seek methods.
 type WriteSeeker interface {
        Writer