aboutsummaryrefslogtreecommitdiff
path: root/src/flag
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-16 00:49:02 -0400
committerRuss Cox <rsc@golang.org>2020-10-20 18:41:18 +0000
commit1b09d430678d4a6f73b2443463d11f75851aba8a (patch)
treefec040abfc6e1d897f8dcdbb856e77d5bccbb2ca /src/flag
parentcb0a0f52e67f128c6ad69027c9a8c7a5caf58446 (diff)
downloadgo-1b09d430678d4a6f73b2443463d11f75851aba8a.tar.gz
go-1b09d430678d4a6f73b2443463d11f75851aba8a.zip
all: update references to symbols moved from io/ioutil to io
The old ioutil references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. Also excluded vendored code. For #41190. Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/263142 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/flag')
-rw-r--r--src/flag/flag_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/flag/flag_test.go b/src/flag/flag_test.go
index 2793064511..06cab79405 100644
--- a/src/flag/flag_test.go
+++ b/src/flag/flag_test.go
@@ -10,7 +10,6 @@ import (
"fmt"
"internal/testenv"
"io"
- "io/ioutil"
"os"
"os/exec"
"runtime"
@@ -545,7 +544,7 @@ func TestGetters(t *testing.T) {
func TestParseError(t *testing.T) {
for _, typ := range []string{"bool", "int", "int64", "uint", "uint64", "float64", "duration"} {
fs := NewFlagSet("parse error test", ContinueOnError)
- fs.SetOutput(ioutil.Discard)
+ fs.SetOutput(io.Discard)
_ = fs.Bool("bool", false, "")
_ = fs.Int("int", 0, "")
_ = fs.Int64("int64", 0, "")
@@ -576,7 +575,7 @@ func TestRangeError(t *testing.T) {
}
for _, arg := range bad {
fs := NewFlagSet("parse error test", ContinueOnError)
- fs.SetOutput(ioutil.Discard)
+ fs.SetOutput(io.Discard)
_ = fs.Int("int", 0, "")
_ = fs.Int64("int64", 0, "")
_ = fs.Uint("uint", 0, "")