diff options
author | Russ Cox <rsc@golang.org> | 2008-12-18 22:37:22 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2008-12-18 22:37:22 -0800 |
commit | 89995dcecf37b9a21c26783dcf8ab506da237363 (patch) | |
tree | 851fad01a87b8fa071ed46fa0985f1857d9e47ca /src/lib/io/io.go | |
parent | 924e27f38d133bc7c9978a061b20f950554434ee (diff) | |
download | golang-89995dcecf37b9a21c26783dcf8ab506da237363.tar.gz |
convert *[] to [].
R=r
OCL=21563
CL=21571
Diffstat (limited to 'src/lib/io/io.go')
-rw-r--r-- | src/lib/io/io.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/io/io.go b/src/lib/io/io.go index 26c2aaab7..af6a9fee9 100644 --- a/src/lib/io/io.go +++ b/src/lib/io/io.go @@ -12,21 +12,21 @@ import ( export var ErrEOF = os.NewError("EOF") export type Read interface { - Read(p *[]byte) (n int, err *os.Error); + Read(p []byte) (n int, err *os.Error); } export type Write interface { - Write(p *[]byte) (n int, err *os.Error); + Write(p []byte) (n int, err *os.Error); } export type ReadWrite interface { - Read(p *[]byte) (n int, err *os.Error); - Write(p *[]byte) (n int, err *os.Error); + Read(p []byte) (n int, err *os.Error); + Write(p []byte) (n int, err *os.Error); } export type ReadWriteClose interface { - Read(p *[]byte) (n int, err *os.Error); - Write(p *[]byte) (n int, err *os.Error); + Read(p []byte) (n int, err *os.Error); + Write(p []byte) (n int, err *os.Error); Close() *os.Error; } @@ -41,7 +41,7 @@ export func WriteString(w Write, s string) (n int, err *os.Error) { } // Read until buffer is full, EOF, or error -export func Readn(fd Read, buf *[]byte) (n int, err *os.Error) { +export func Readn(fd Read, buf []byte) (n int, err *os.Error) { n = 0; for n < len(buf) { nn, e := fd.Read(buf[n:len(buf)]); @@ -64,7 +64,7 @@ type FullRead struct { fd Read; } -func (fd *FullRead) Read(p *[]byte) (n int, err *os.Error) { +func (fd *FullRead) Read(p []byte) (n int, err *os.Error) { n, err = Readn(fd.fd, p); return n, err } @@ -147,7 +147,7 @@ export func Copy(src Read, dst Write) (written int64, err *os.Error) { // Convert a string to an array of bytes for easy marshaling. // Could fill with syscall.StringToBytes but it adds an unnecessary \000 // so the length would be wrong. -export func StringBytes(s string) *[]byte { +export func StringBytes(s string) []byte { b := new([]byte, len(s)); for i := 0; i < len(s); i++ { b[i] = s[i]; |