diff options
| author | Eric Biggers <ebiggers@google.com> | 2022-12-04 13:27:43 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers3@gmail.com> | 2022-12-04 14:07:39 -0800 |
| commit | 02875cef9010633b6689cfd1e2ceec9107b756b4 (patch) | |
| tree | 9f310eac398e99dd12f42d94967b2e1bf1c7fe83 /filesystem/mountpoint_test.go | |
| parent | 5373b314473b08f13372ab55b551738307a85fbd (diff) | |
Stop using deprecated package io/ioutil
Since Go 1.16 (which recently became the minimum supported Go version
for this project), the package io/ioutil is deprecated in favor of
equivalent functionality in the io and os packages. staticcheck warns
about this. Address all the warnings by switching to the non-deprecated
replacement functions.
Diffstat (limited to 'filesystem/mountpoint_test.go')
| -rw-r--r-- | filesystem/mountpoint_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/filesystem/mountpoint_test.go b/filesystem/mountpoint_test.go index 99d4b55..43b5a0d 100644 --- a/filesystem/mountpoint_test.go +++ b/filesystem/mountpoint_test.go @@ -26,7 +26,6 @@ package filesystem import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -122,7 +121,7 @@ func TestLoadSourceDevice(t *testing.T) { func TestNondirectoryMountsIgnored(t *testing.T) { beginLoadMountInfoTest() defer endLoadMountInfoTest() - file, err := ioutil.TempFile("", "fscrypt_regfile") + file, err := os.CreateTemp("", "fscrypt_regfile") if err != nil { t.Fatal(err) } @@ -155,7 +154,7 @@ func TestNonLatestMountsIgnored(t *testing.T) { // Test that escape sequences in the mountinfo file are unescaped correctly. func TestLoadMountWithSpecialCharacters(t *testing.T) { - tempDir, err := ioutil.TempDir("", "fscrypt") + tempDir, err := os.MkdirTemp("", "fscrypt") if err != nil { t.Fatal(err) } @@ -296,7 +295,7 @@ func TestRootMountpointIsPreferred(t *testing.T) { // Test that a mountpoint that is not "/" but still contains all other // mountpoints is preferred, given independent subtrees. func TestHighestMountpointIsPreferred(t *testing.T) { - tempDir, err := ioutil.TempDir("", "fscrypt") + tempDir, err := os.MkdirTemp("", "fscrypt") if err != nil { t.Fatal(err) } @@ -331,7 +330,7 @@ func TestHighestMountpointIsPreferred(t *testing.T) { // mountpoints are contained in other mountpoints, the chosen Mount is the root // of a tree of mountpoints whose mounted subtrees contain all mounted subtrees. func TestLoadContainedSubtreesAndMountpoints(t *testing.T) { - tempDir, err := ioutil.TempDir("", "fscrypt") + tempDir, err := os.MkdirTemp("", "fscrypt") if err != nil { t.Fatal(err) } |