Skip to content

Commit

Permalink
all: remove leftover use of deprecated ioutil (#643)
Browse files Browse the repository at this point in the history
ioutil is deprecated, see https://go.dev/doc/go1.16#ioutil

Follow up on #634

Signed-off-by: Alexander Yastrebov <yastrebov.alex@gmail.com>
Signed-off-by: Tomás Senart <tsenart@gmail.com>
  • Loading branch information
AlexanderYastrebov authored and tsenart committed Aug 18, 2023
1 parent 4063254 commit 712ff2e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/attack.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"math"
"math/rand"
"net"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 712ff2e

Please sign in to comment.