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 <bin@hyper.sh>
This commit is contained in:
bin 2021-12-15 07:31:57 +08:00
parent 03546f75a6
commit 5b002f3c88

View File

@ -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)