From 89ec847f7b1c67aec861f0729b254a12331c205b Mon Sep 17 00:00:00 2001 From: Kyle Nusbaum Date: Wed, 23 Jun 2021 11:45:20 -0500 Subject: [PATCH 1/2] api: change io.Discard to ioutil.Discard --- api/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/api.go b/api/api.go index 4b01b3bfc..a35980a9a 100644 --- a/api/api.go +++ b/api/api.go @@ -1069,7 +1069,7 @@ func requireOK(d time.Duration, resp *http.Response, e error) (time.Duration, *h // is necessary to ensure that the http.Client's underlying RoundTripper is able // to re-use the TCP connection. See godoc on net/http.Client.Do. func closeResponseBody(resp *http.Response) error { - _, _ = io.Copy(io.Discard, resp.Body) + _, _ = io.Copy(ioutil.Discard, resp.Body) return resp.Body.Close() } From 4ad13c37dbd3c818d6ad2d40859206c228327c61 Mon Sep 17 00:00:00 2001 From: Kyle Nusbaum Date: Wed, 23 Jun 2021 11:45:40 -0500 Subject: [PATCH 2/2] command/agent: change io.Discard to ioutil.Discard --- command/agent/agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/agent/agent.go b/command/agent/agent.go index a0a3601c6..fade33e6b 100644 --- a/command/agent/agent.go +++ b/command/agent/agent.go @@ -4,7 +4,7 @@ import ( "context" "flag" "fmt" - "io" + "io/ioutil" "os" "os/signal" "path/filepath" @@ -182,7 +182,7 @@ func (c *cmd) run(args []string) int { if config.Logging.LogJSON { // Hide all non-error output when JSON logging is enabled. ui.Ui = &cli.BasicUI{ - BasicUi: mcli.BasicUi{ErrorWriter: c.ui.Stderr(), Writer: io.Discard}, + BasicUi: mcli.BasicUi{ErrorWriter: c.ui.Stderr(), Writer: ioutil.Discard}, } }