From 939388dc4fc0c1ccd6936045d511b1adc889fb26 Mon Sep 17 00:00:00 2001 From: Sarabpreet Singh Date: Sat, 10 Aug 2024 21:11:38 +1000 Subject: [PATCH] refactor: changing ioutil to io changing ioutil to io as ioutil is deprecated in Go1.16 --- ch1/fetch/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ch1/fetch/main.go b/ch1/fetch/main.go index e704ae688..72762db46 100644 --- a/ch1/fetch/main.go +++ b/ch1/fetch/main.go @@ -9,7 +9,7 @@ package main import ( "fmt" - "io/ioutil" + "io" "net/http" "os" ) @@ -21,7 +21,7 @@ func main() { fmt.Fprintf(os.Stderr, "fetch: %v\n", err) os.Exit(1) } - b, err := ioutil.ReadAll(resp.Body) + b, err := io.ReadAll(resp.Body) resp.Body.Close() if err != nil { fmt.Fprintf(os.Stderr, "fetch: reading %s: %v\n", url, err)