Skip to content

Commit

Permalink
Remove references to io/ioutil package
Browse files Browse the repository at this point in the history
io/ioutil has been marked deprecated in Go 1.16.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
  • Loading branch information
austinvazquez committed Oct 25, 2022
1 parent 31de245 commit fecb8c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions integration/cni_setup_teardown_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"context"
"crypto/rand"
"fmt"
"io/ioutil"
"os"
"path"
"runtime"
Expand Down Expand Up @@ -146,7 +145,7 @@ func TestBasicSetupAndRemove(t *testing.T) {
defer os.RemoveAll(tmpPluginConfDir)

assert.NoError(t,
ioutil.WriteFile(
os.WriteFile(
path.Join(tmpPluginConfDir, "10-gocni-test-net.conflist"),
[]byte(cniBridgePluginCfg),
0600,
Expand Down Expand Up @@ -231,7 +230,7 @@ func TestBasicSetupAndRemovePluginWithoutVersion(t *testing.T) {
defer os.RemoveAll(tmpPluginConfDir)

assert.NoError(t,
ioutil.WriteFile(
os.WriteFile(
path.Join(tmpPluginConfDir, "10-gocni-test-net.conflist"),
[]byte(cniBridgePluginCfgWithoutVersion),
0600,
Expand Down
3 changes: 1 addition & 2 deletions testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ package cni

import (
"fmt"
"io/ioutil"
"os"
"path"
"testing"
)

func makeTmpDir(prefix string) (string, error) {
tmpDir, err := ioutil.TempDir(os.TempDir(), prefix)
tmpDir, err := os.MkdirTemp("", prefix)
if err != nil {
return "", err
}
Expand Down

0 comments on commit fecb8c8

Please sign in to comment.