aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/http/triv.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/http/triv.go b/src/net/http/triv.go
index 9bf0caa37f..4c2160bbc3 100644
--- a/src/net/http/triv.go
+++ b/src/net/http/triv.go
@@ -7,7 +7,6 @@
package main
import (
- "bytes"
"expvar"
"flag"
"fmt"
@@ -17,6 +16,7 @@ import (
"os"
"os/exec"
"strconv"
+ "strings"
"sync"
)
@@ -49,7 +49,7 @@ func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
case "GET":
ctr.n++
case "POST":
- buf := new(bytes.Buffer)
+ var buf strings.Builder
io.Copy(buf, req.Body)
body := buf.String()
if n, err := strconv.Atoi(body); err != nil {