@@ -21,7 +21,7 @@ import (
2121 "encoding/json"
2222 "github.com/ghodss/yaml"
2323 "github.com/santhosh-tekuri/jsonschema"
24- "io/ioutil "
24+ "io"
2525 "os"
2626 "path/filepath"
2727 "strings"
@@ -62,7 +62,7 @@ func Test_Schema(t *testing.T) {
6262 os .Mkdir (tempDir , 0755 )
6363
6464 // Read the content of the jso directory to find test files
65- files , err := ioutil .ReadDir (jsonDir )
65+ files , err := os .ReadDir (jsonDir )
6666 if err != nil {
6767 t .Fatalf ("Error finding test json files in : %s : %v" , jsonDir , err )
6868 }
@@ -82,7 +82,7 @@ func Test_Schema(t *testing.T) {
8282 }
8383
8484 // Read contents of the json file which defines the tests to run
85- byteValue , err := ioutil .ReadAll (testJson )
85+ byteValue , err := io .ReadAll (testJson )
8686 if err != nil {
8787 t .Errorf ("FAIL : failed to read : %s : %v" , testJsonFile .Name (), err )
8888 }
@@ -127,7 +127,7 @@ func Test_Schema(t *testing.T) {
127127 }
128128
129129 // Read contents of the json file which defines the tests to run
130- byteValue , err := ioutil .ReadAll (testsToRunJson )
130+ byteValue , err := io .ReadAll (testsToRunJson )
131131 if err != nil {
132132 t .Fatalf ("FAIL : failed to read : %s : %v" , testJsonContent .Tests [m ], err )
133133 }
@@ -165,7 +165,7 @@ func Test_Schema(t *testing.T) {
165165 // Now add each of the yaml sippets used the make the yaml file for test
166166 for j := 0 ; j < len (testsToRunContent .Tests [i ].Files ); j ++ {
167167 // Read the snippet
168- data , err := ioutil .ReadFile (filepath .Join (testDir , testsToRunContent .Tests [i ].Files [j ]))
168+ data , err := os .ReadFile (filepath .Join (testDir , testsToRunContent .Tests [i ].Files [j ]))
169169 if err != nil {
170170 t .Errorf ("FAIL: failed reading %s: %v" , filepath .Join (testDir , testsToRunContent .Tests [i ].Files [j ]), err )
171171 testYamlComplete = false
@@ -186,7 +186,7 @@ func Test_Schema(t *testing.T) {
186186 }
187187
188188 // Read the created yaml file, ready for converison to json
189- data , err := ioutil .ReadFile (filepath .Join (testTempDir , testsToRunContent .Tests [i ].FileName ))
189+ data , err := os .ReadFile (filepath .Join (testTempDir , testsToRunContent .Tests [i ].FileName ))
190190 if err != nil {
191191 t .Errorf (" FAIL: unable to read %s: %v" , testsToRunContent .Tests [i ].FileName , err )
192192 f .Close ()
0 commit comments