From 9814dd34b23dbb6e1ab992f80d4fb388863cd200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E9=9C=B2=E5=85=88=E7=94=9F?= Date: Tue, 16 Apr 2024 01:39:03 +0800 Subject: [PATCH] drop io/utils package. (#1188) /kind cleanup Drop ioutil package. As it is deprecation , and can be replaced well. ``` Deprecated: As of Go 1.16, the same functionality is now provided by package [io](https://pkg.go.dev/io) or package [os](https://pkg.go.dev/os), and those implementations should be preferred in new code ``` Signed-off-by: zhanluxianshen --- app_windows_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app_windows_test.go b/app_windows_test.go index 1cca3620a..795b75ac7 100644 --- a/app_windows_test.go +++ b/app_windows_test.go @@ -27,7 +27,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "os" "os/exec" "syscall" @@ -84,9 +83,9 @@ func TestWindowsCtrlCHandler(t *testing.T) { "SIGINT child process") // Drain stdout and stderr, and wait for the process to exit. - output, err := ioutil.ReadAll(stdout) + output, err := io.ReadAll(stdout) require.NoError(t, err) - _, err = io.Copy(ioutil.Discard, stderr) + _, err = io.Copy(io.Discard, stderr) require.NoError(t, err) require.NoError(t, cmd.Wait())