From 712ff2e55f42d6c70ca311eafde55731cf3a08dc Mon Sep 17 00:00:00 2001 From: Alexander Yastrebov Date: Thu, 17 Aug 2023 13:01:54 +0200 Subject: [PATCH] all: remove leftover use of deprecated ioutil (#643) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ioutil is deprecated, see https://go.dev/doc/go1.16#ioutil Follow up on #634 Signed-off-by: Alexander Yastrebov Signed-off-by: Tomás Senart --- lib/attack.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/attack.go b/lib/attack.go index caebba6f..c22325cc 100644 --- a/lib/attack.go +++ b/lib/attack.go @@ -5,7 +5,6 @@ import ( "crypto/tls" "fmt" "io" - "io/ioutil" "math" "math/rand" "net" @@ -541,9 +540,9 @@ func (a *Attacker) hit(tr Targeter, atk *attack) *Result { body = io.LimitReader(r.Body, a.maxBody) } - if res.Body, err = ioutil.ReadAll(body); err != nil { + if res.Body, err = io.ReadAll(body); err != nil { return &res - } else if _, err = io.Copy(ioutil.Discard, r.Body); err != nil { + } else if _, err = io.Copy(io.Discard, r.Body); err != nil { return &res }