From d47d888ba663014e6aa8ca043e694f4b2a5898b8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 18 Dec 2008 22:37:22 -0800 Subject: convert *[] to []. R=r OCL=21563 CL=21571 --- src/lib/http/request.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lib/http') diff --git a/src/lib/http/request.go b/src/lib/http/request.go index eea1b3e49d..36fa77033f 100644 --- a/src/lib/http/request.go +++ b/src/lib/http/request.go @@ -45,16 +45,18 @@ export type Request struct { useragent string; } +var NIL []byte // TODO(rsc) + // Read a line of bytes (up to \n) from b. // Give up if the line exceeds MaxLineLength. // The returned bytes are a pointer into storage in // the bufio, so they are only valid until the next bufio read. -func ReadLineBytes(b *bufio.BufRead) (p *[]byte, err *os.Error) { +func ReadLineBytes(b *bufio.BufRead) (p []byte, err *os.Error) { if p, err = b.ReadLineSlice('\n'); err != nil { - return nil, err + return NIL, err } if len(p) >= MaxLineLength { - return nil, LineTooLong + return NIL, LineTooLong } // Chop off trailing white space. @@ -189,7 +191,7 @@ export func ReadRequest(b *bufio.BufRead) (req *Request, err *os.Error) { return nil, err } - var f *[]string; + var f []string; if f = strings.split(s, " "); len(f) != 3 { return nil, BadRequest } -- cgit v1.3-5-g9baa