Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update io reading functions with non-deprecated counterparts #148

Merged
merged 2 commits into from
May 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
machawk1 marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading