diff options
author | Rob Pike <r@golang.org> | 2009-09-17 23:51:06 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-09-17 23:51:06 -0700 |
commit | 7b79ee2545d11bb332aa2ba5e2b1a2509b0aa313 (patch) | |
tree | df353ed3ad6cfa68e97dbaba2e601842547d1dd5 /src/pkg/http/triv.go | |
parent | 94cb5a646b38b4ac3c4b9e04409e6e5a5e6d5056 (diff) | |
download | golang-7b79ee2545d11bb332aa2ba5e2b1a2509b0aa313.tar.gz |
use buf.String() instead of string(buf.Bytes())
use strings.Buffer instead of bytes.Buffer in some places
R=rsc
DELTA=40 (0 added, 3 deleted, 37 changed)
OCL=34770
CL=34775
Diffstat (limited to 'src/pkg/http/triv.go')
-rw-r--r-- | src/pkg/http/triv.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/http/triv.go b/src/pkg/http/triv.go index 23ec9849f..900dcbb5b 100644 --- a/src/pkg/http/triv.go +++ b/src/pkg/http/triv.go @@ -43,7 +43,7 @@ func (ctr *Counter) ServeHTTP(c *http.Conn, req *http.Request) { case "POST": buf := new(bytes.Buffer); io.Copy(req.Body, buf); - body := string(buf.Bytes()); + body := buf.String(); if n, err := strconv.Atoi(body); err != nil { fmt.Fprintf(c, "bad POST: %v\nbody: [%v]\n", err, body); } else { |