Skip to content

Commit

Permalink
Merge pull request #10473 from knusbaum/ioutil
Browse files Browse the repository at this point in the history
{api,command/agent}: change io.Discard to ioutil.Discard
  • Loading branch information
dnephin authored and hc-github-team-consul-core committed Jun 29, 2021
1 parent 5d86fe4 commit dfc655a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
4 changes: 2 additions & 2 deletions command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"os/signal"
"path/filepath"
Expand Down Expand Up @@ -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},
}
}

Expand Down

0 comments on commit dfc655a

Please sign in to comment.