From 5b002f3c88687b4a590e742cfca8e4665e1ee354 Mon Sep 17 00:00:00 2001 From: bin Date: Wed, 15 Dec 2021 07:31:57 +0800 Subject: [PATCH] docs: change io/ioutil to io/os packages Change io/ioutil to io/os packages because io/ioutil package is deprecated from 1.16: TempDir => os.MkdirTemp Details: https://go.dev/doc/go1.16#ioutil Fixes: #3265 Signed-off-by: bin --- docs/Unit-Test-Advice.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Unit-Test-Advice.md b/docs/Unit-Test-Advice.md index 5fe8b9cafc..8cbf3163f6 100644 --- a/docs/Unit-Test-Advice.md +++ b/docs/Unit-Test-Advice.md @@ -286,8 +286,8 @@ func TestSomething(t *testing.T) { assert := assert.New(t) // Create a temporary directory - tmpdir, err := ioutil.TempDir("", "") - assert.NoError(err) + tmpdir, err := os.MkdirTemp("", "") + assert.NoError(err) // Delete it at the end of the test defer os.RemoveAll(tmpdir)