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)