diff options
author | Russ Cox <rsc@golang.org> | 2009-05-15 10:46:14 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-15 10:46:14 -0700 |
commit | c2403ab02d15bf0d7e8326a5f24b855f4444fca6 (patch) | |
tree | 8ebcabfca5794dcec7d42c343b35b5d0473d3ff4 /src/lib/io/bytebuffer.go | |
parent | 4f4eaced84224f19972c31c32b34919964823daf (diff) | |
download | golang-c2403ab02d15bf0d7e8326a5f24b855f4444fca6.tar.gz |
Return error from WriteByte, to match bufio.Writer.
R=gri
DELTA=4 (1 added, 0 deleted, 3 changed)
OCL=28868
CL=28899
Diffstat (limited to 'src/lib/io/bytebuffer.go')
-rw-r--r-- | src/lib/io/bytebuffer.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go index 5d4cd8add..c862818fd 100644 --- a/src/lib/io/bytebuffer.go +++ b/src/lib/io/bytebuffer.go @@ -75,10 +75,11 @@ func (b *ByteBuffer) Write(p []byte) (n int, err os.Error) { } // WriteByte appends the byte c to the buffer. -// Because Write never fails and WriteByte is not part of the -// io.Writer interface, it does not need to return a value. -func (b *ByteBuffer) WriteByte(c byte) { +// The returned error is always nil, but is included +// to match bufio.Writer's WriteByte. +func (b *ByteBuffer) WriteByte(c byte) os.Error { b.Write([]byte{c}); + return nil; } // Read reads the next len(p) bytes from the buffer or until the buffer |