diff --git a/client.go b/client.go index 0d4669c7..b76a77ab 100644 --- a/client.go +++ b/client.go @@ -750,7 +750,7 @@ func (a *Agent) Bytes() (code int, body []byte, errs []error) { code = resp.StatusCode() } - body = append(a.dest[:0], resp.Body()...) + body = append(a.dest, resp.Body()...) if nilResp { ReleaseResponse(resp) diff --git a/client_test.go b/client_test.go index ee1830fc..73fc94e6 100644 --- a/client_test.go +++ b/client_test.go @@ -537,7 +537,7 @@ func Test_Client_Agent_Dest(t *testing.T) { a.HostClient.Dial = func(addr string) (net.Conn, error) { return ln.Dial() } - code, body, errs := a.Dest(dest).String() + code, body, errs := a.Dest(dest[:0]).String() utils.AssertEqual(t, StatusOK, code) utils.AssertEqual(t, "dest", body) @@ -552,7 +552,7 @@ func Test_Client_Agent_Dest(t *testing.T) { a.HostClient.Dial = func(addr string) (net.Conn, error) { return ln.Dial() } - code, body, errs := a.Dest(dest).String() + code, body, errs := a.Dest(dest[:0]).String() utils.AssertEqual(t, StatusOK, code) utils.AssertEqual(t, "dest", body)