io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package harness
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -56,11 +55,11 @@ func (h *Harness) Close() {
|
||||
}
|
||||
}
|
||||
|
||||
// TempDir is a wrapper around ioutil.TempDir for tests.
|
||||
// TempDir is a wrapper around os.MkdirTemp for tests.
|
||||
// It automatically fails the test if we can't create a temp file,
|
||||
// and deletes the temp directory when Close is called on the Harness
|
||||
func (h *Harness) TempDir(baseDir string, prefix string) string {
|
||||
tempDir, err := ioutil.TempDir(baseDir, prefix)
|
||||
tempDir, err := os.MkdirTemp(baseDir, prefix)
|
||||
if err != nil {
|
||||
h.Fatalf("unable to create tempdir: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user