Skip to content

Commit

Permalink
fix capacity allocation (#53)
Browse files Browse the repository at this point in the history
buf should have the desired capacity but a length of zero
  • Loading branch information
maxprihodko authored and bgaifullin committed Nov 19, 2018
1 parent 71af614 commit cf1a6aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func formatDate(value time.Time) string {

func readResponse(response *http.Response) (result []byte, err error) {
if response.ContentLength > 0 {
result = make([]byte, response.ContentLength)
result = make([]byte, 0, response.ContentLength)
}
buf := bytes.NewBuffer(result)
defer response.Body.Close()
Expand Down

0 comments on commit cf1a6aa

Please sign in to comment.