Skip to content

Commit

Permalink
Update io reading functions with non-deprecated counterparts
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed May 9, 2024
1 parent 8fd5a11 commit aed027f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"container/list"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
Expand Down Expand Up @@ -169,7 +170,7 @@ var spoofAgents = []string{

func readArchives() (body []byte, err error) {
if !regs["isprtcl"].MatchString(*arcsloc) {
body, err = ioutil.ReadFile(*arcsloc)
body, err = os.ReadFile(*arcsloc)
return
}
res, err := http.Get(*arcsloc)
Expand All @@ -181,7 +182,7 @@ func readArchives() (body []byte, err error) {
err = fmt.Errorf(res.Status)
return
}
body, err = ioutil.ReadAll(res.Body)
body, err = io.ReadAll(res.Body)
return
}

Expand Down Expand Up @@ -312,7 +313,7 @@ func fetchTimemap(urir string, arch *Archive, tmCh chan *list.List, wg *sync.Wai
}
lnks := res.Header.Get("Link")
if dttmp == nil {
body, err := ioutil.ReadAll(res.Body)
body, err := io.ReadAll(res.Body)
if err != nil {
benchmarker(arch.ID, "timemapfetch", fmt.Sprintf("Response read error in %s", arch.Name), start, sess)
logError.Printf("%s => Response read error: %v", arch.ID, err)
Expand Down

0 comments on commit aed027f

Please sign in to comment.