Replace deprecated ioutil with io
This commit is contained in:
parent
542fdfd9a6
commit
7bee2d4540
@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@ -182,7 +182,7 @@ func fetchCard(setName, collectorNumber string) (*Card, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//We Read the response body on the line below.
|
//We Read the response body on the line below.
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("%s", err)
|
log.Fatalf("%s", err)
|
||||||
return &Card{}, err
|
return &Card{}, err
|
||||||
@ -220,7 +220,7 @@ func fetchSets() (*SetList, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//We Read the response body on the line below.
|
//We Read the response body on the line below.
|
||||||
body, err := ioutil.ReadAll(resp.Body)
|
body, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
return &SetList{}, err
|
return &SetList{}, err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user