From f068a4c6dfd498bc383997c77557dc74e262e9a2 Mon Sep 17 00:00:00 2001 From: Reed Allman Date: Thu, 7 Sep 2017 04:44:07 -0700 Subject: [PATCH] oops, try to pre-allocate slice of useful size but if not allow expansion --- api/server/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server/runner.go b/api/server/runner.go index 033d350f6..11223b45c 100644 --- a/api/server/runner.go +++ b/api/server/runner.go @@ -63,7 +63,7 @@ func (s *Server) serve(c *gin.Context, appName, path string) { if model.Type == "async" { // TODO we should push this into GetCall somehow (CallOpt maybe) or maybe agent.Queue(Call) ? - buf := bytes.NewBuffer(make([]byte, 0, c.Request.ContentLength)) // TODO sync.Pool me + buf := bytes.NewBuffer(make([]byte, c.Request.ContentLength)[:0]) // TODO sync.Pool me _, err := buf.ReadFrom(c.Request.Body) if err != nil { handleErrorResponse(c, models.ErrInvalidPayload)