From 42bb667dd47806e0526f76fb7c3b556f43fb2a96 Mon Sep 17 00:00:00 2001 From: Adam Chalkley Date: Wed, 24 Aug 2022 06:12:30 -0500 Subject: [PATCH] Swap io/ioutil package for io package --- internal/lockss/init.go | 6 +++--- internal/lockss/load.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/lockss/init.go b/internal/lockss/init.go index 78f8c97..796032f 100644 --- a/internal/lockss/init.go +++ b/internal/lockss/init.go @@ -8,7 +8,7 @@ package lockss import ( - "io/ioutil" + "io" "log" "os" ) @@ -24,7 +24,7 @@ func init() { // Disable logging output by default unless client code explicitly // requests it logger = log.New(os.Stderr, "[go-lockss/lockss] ", 0) - logger.SetOutput(ioutil.Discard) + logger.SetOutput(io.Discard) } @@ -39,5 +39,5 @@ func EnableLogging() { // all logging output. func DisableLogging() { logger.SetFlags(0) - logger.SetOutput(ioutil.Discard) + logger.SetOutput(io.Discard) } diff --git a/internal/lockss/load.go b/internal/lockss/load.go index 7e7503f..1aeb421 100644 --- a/internal/lockss/load.go +++ b/internal/lockss/load.go @@ -13,7 +13,7 @@ import ( "context" "errors" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "os" @@ -185,7 +185,7 @@ func (c *Config) loadFromPropsURLWithContext(ctx context.Context, url string) (* // Get the response body directly. We'll create a bytes buffer later to // wrap the response data in order to provide an io.Reader where needed. - responseData, err := ioutil.ReadAll(resp.Body) + responseData, err := io.ReadAll(resp.Body) if err != nil { logger.Println(err) return nil, err