diff --git a/jsonc.go b/jsonc.go index 12c2dfb..745bc65 100644 --- a/jsonc.go +++ b/jsonc.go @@ -24,7 +24,7 @@ package jsonc import ( "encoding/json" - "io/ioutil" + "os" ) // ToJSON returns JSON equivalent of JSON with comments @@ -34,7 +34,7 @@ func ToJSON(b []byte) []byte { // ReadFromFile reads jsonc file and returns JSONC and JSON encodings func ReadFromFile(filename string) ([]byte, []byte, error) { - data, err := ioutil.ReadFile(filename) + data, err := os.ReadFile(filename) if err != nil { return nil, nil, err } diff --git a/jsonc_test.go b/jsonc_test.go index ad980d0..b295b49 100644 --- a/jsonc_test.go +++ b/jsonc_test.go @@ -2,7 +2,6 @@ package jsonc import ( "encoding/json" - "io/ioutil" "os" "reflect" "testing" @@ -115,7 +114,7 @@ func TestUnmarshal(t *testing.T) { } func TestReadFromFile(t *testing.T) { - tmp, err := ioutil.TempFile("", "ReadFromFileTest") + tmp, err := os.CreateTemp("", "ReadFromFileTest") if err != nil { t.Skip("Unable to create temp file.", err) }