From: Russ Cox Date: Fri, 15 May 2009 17:46:14 +0000 (-0700) Subject: Return error from WriteByte, to match bufio.Writer. X-Git-Tag: weekly.2009-11-06~1635 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=55b70d6c98d0a12345e0e055c7cc0fd3297255f8;p=gostls13.git Return error from WriteByte, to match bufio.Writer. R=gri DELTA=4 (1 added, 0 deleted, 3 changed) OCL=28868 CL=28899 --- diff --git a/src/lib/io/bytebuffer.go b/src/lib/io/bytebuffer.go index 5d4cd8add3..c862818fd7 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