@@ -7,7 +7,6 @@ package main
7
7
import (
8
8
"bytes"
9
9
"fmt"
10
- "io/ioutil"
11
10
"log"
12
11
"os"
13
12
"os/exec"
@@ -101,7 +100,7 @@ func TestGofmt(t *testing.T) {
101
100
102
101
func TestGoPyErrors (t * testing.T ) {
103
102
pyvm := testBackends ["py3" ]
104
- workdir , err := ioutil . TempDir ("" , "gopy-" )
103
+ workdir , err := os . MkdirTemp ("" , "gopy-" )
105
104
if err != nil {
106
105
t .Fatalf ("could not create workdir: %v\n " , err )
107
106
}
@@ -886,14 +885,14 @@ don't modify manually.
886
885
}
887
886
888
887
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 )
890
889
if err != nil {
891
890
log .Fatalf ("Unable to write SUPPORT_MATRIX.md" )
892
891
}
893
892
return
894
893
}
895
894
896
- src , err := ioutil .ReadFile ("SUPPORT_MATRIX.md" )
895
+ src , err := os .ReadFile ("SUPPORT_MATRIX.md" )
897
896
if err != nil {
898
897
log .Fatalf ("Unable to read SUPPORT_MATRIX.md" )
899
898
}
@@ -952,7 +951,7 @@ require github.com/go-python/gopy v0.0.0
952
951
replace github.com/go-python/gopy => %s
953
952
`
954
953
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 {
956
955
t .Fatalf ("failed to write go.mod file: %v" , err )
957
956
}
958
957
}
@@ -961,7 +960,7 @@ func testPkgBackend(t *testing.T, pyvm string, table pkg) {
961
960
curPkgPath := reflect .TypeOf (table ).PkgPath ()
962
961
_ , pkgNm := filepath .Split (table .path )
963
962
cwd , _ := os .Getwd ()
964
- workdir , err := ioutil . TempDir ("" , "gopy-" )
963
+ workdir , err := os . MkdirTemp ("" , "gopy-" )
965
964
if err != nil {
966
965
t .Fatalf ("[%s:%s]: could not create workdir: %v\n " , pyvm , table .path , err )
967
966
}
0 commit comments