@@ -7,7 +7,6 @@ package main
77import (
88 "bytes"
99 "fmt"
10- "io/ioutil"
1110 "log"
1211 "os"
1312 "os/exec"
@@ -101,7 +100,7 @@ func TestGofmt(t *testing.T) {
101100
102101func TestGoPyErrors (t * testing.T ) {
103102 pyvm := testBackends ["py3" ]
104- workdir , err := ioutil . TempDir ("" , "gopy-" )
103+ workdir , err := os . MkdirTemp ("" , "gopy-" )
105104 if err != nil {
106105 t .Fatalf ("could not create workdir: %v\n " , err )
107106 }
@@ -886,14 +885,14 @@ don't modify manually.
886885 }
887886
888887 if os .Getenv ("GOPY_GENERATE_SUPPORT_MATRIX" ) == "1" {
889- err := ioutil .WriteFile ("SUPPORT_MATRIX.md" , buf .Bytes (), 0644 )
888+ err := os .WriteFile ("SUPPORT_MATRIX.md" , buf .Bytes (), 0644 )
890889 if err != nil {
891890 log .Fatalf ("Unable to write SUPPORT_MATRIX.md" )
892891 }
893892 return
894893 }
895894
896- src , err := ioutil .ReadFile ("SUPPORT_MATRIX.md" )
895+ src , err := os .ReadFile ("SUPPORT_MATRIX.md" )
897896 if err != nil {
898897 log .Fatalf ("Unable to read SUPPORT_MATRIX.md" )
899898 }
@@ -952,7 +951,7 @@ require github.com/go-python/gopy v0.0.0
952951replace github.com/go-python/gopy => %s
953952`
954953 contents := fmt .Sprintf (template , pkgDir )
955- if err := ioutil .WriteFile (filepath .Join (tstDir , "go.mod" ), []byte (contents ), 0666 ); err != nil {
954+ if err := os .WriteFile (filepath .Join (tstDir , "go.mod" ), []byte (contents ), 0666 ); err != nil {
956955 t .Fatalf ("failed to write go.mod file: %v" , err )
957956 }
958957}
@@ -961,7 +960,7 @@ func testPkgBackend(t *testing.T, pyvm string, table pkg) {
961960 curPkgPath := reflect .TypeOf (table ).PkgPath ()
962961 _ , pkgNm := filepath .Split (table .path )
963962 cwd , _ := os .Getwd ()
964- workdir , err := ioutil . TempDir ("" , "gopy-" )
963+ workdir , err := os . MkdirTemp ("" , "gopy-" )
965964 if err != nil {
966965 t .Fatalf ("[%s:%s]: could not create workdir: %v\n " , pyvm , table .path , err )
967966 }
0 commit comments