Drop references to io/ioutil (#403)

io/ioutil has been deprecated for a while.
Replace all uses of it with equivalent APIs.
This commit is contained in:
Abhinav Gupta
2023-12-10 15:40:40 -08:00
committed by GitHub
parent 923c202213
commit 7391017a8c
6 changed files with 10 additions and 14 deletions
+2 -3
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math"
"net/url"
"os"
@@ -269,7 +268,7 @@ func TestFileContentFlag(t *testing.T) {
var cli struct {
File kong.FileContentFlag
}
f, err := ioutil.TempFile("", "")
f, err := os.CreateTemp("", "")
assert.NoError(t, err)
defer os.Remove(f.Name())
fmt.Fprint(f, "hello world")
@@ -283,7 +282,7 @@ func TestNamedFileContentFlag(t *testing.T) {
var cli struct {
File kong.NamedFileContentFlag
}
f, err := ioutil.TempFile("", "")
f, err := os.CreateTemp("", "")
assert.NoError(t, err)
defer os.Remove(f.Name())
fmt.Fprint(f, "hello world")