summaryrefslogtreecommitdiff
path: root/src/lib/io/io.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-18 11:47:35 -0700
committerRuss Cox <rsc@golang.org>2009-05-18 11:47:35 -0700
commitedf6db4a45a7b3258369f612bb9ec60e95ac2315 (patch)
treeef7bc7c2538bd2c3b0925719262205c1661fa628 /src/lib/io/io.go
parentdf7681858bd5b1294bddfbbef6fb734b35d29dd8 (diff)
downloadgolang-edf6db4a45a7b3258369f612bb9ec60e95ac2315.tar.gz
move ShortWrite error into io so that other packages can use it.
R=r DELTA=15 (7 added, 1 deleted, 7 changed) OCL=28996 CL=28996
Diffstat (limited to 'src/lib/io/io.go')
-rw-r--r--src/lib/io/io.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/io/io.go b/src/lib/io/io.go
index b28359359..70c82d562 100644
--- a/src/lib/io/io.go
+++ b/src/lib/io/io.go
@@ -13,12 +13,19 @@ import (
"os";
)
-// ErrEOF is the error returned by FullRead and Copyn when they encounter EOF.
+// Error represents an unexpected I/O behavior.
type Error struct {
os.ErrorString
}
+
+// ErrEOF means that data was expected, but a read got EOF instead.
var ErrEOF os.Error = &Error{"EOF"}
+// ErrShortWrite means that a write accepted fewer bytes than requested
+// but failed to return an explicit error.
+var ErrShortWrite os.Error = &Error{"short write"}
+
+
// Reader is the interface that wraps the basic Read method.
type Reader interface {
Read(p []byte) (n int, err os.Error);