Skip to content

Commit

Permalink
replace ioutil.TempFile with os.CreateTemp
Browse files Browse the repository at this point in the history
  • Loading branch information
stefafafan committed Nov 17, 2022
1 parent 84bff88 commit e14a9f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions drivers/binary_driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"reflect"
"runtime"
"strings"
Expand All @@ -31,7 +31,7 @@ func TestBinaryDriver(t *testing.T) {
t.Fatal(err)
}

bin, err := ioutil.TempFile("", "test_binary_driver")
bin, err := os.CreateTemp("", "test_binary_driver")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -61,7 +61,7 @@ func TestBinaryWarningDriver(t *testing.T) {
t.Skip("cannot run binary test on windows (needs bin/sh)")
}

bin, err := ioutil.TempFile("", "test_binary_driver")
bin, err := os.CreateTemp("", "test_binary_driver")
if err != nil {
t.Fatal(err)
}
Expand All @@ -87,7 +87,7 @@ func TestBinaryBadDriver(t *testing.T) {
t.Skip("cannot run binary test on windows (needs bin/sh)")
}

bin, err := ioutil.TempFile("", "test_binary_driver")
bin, err := os.CreateTemp("", "test_binary_driver")
if err != nil {
t.Fatal(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (m *mysqlTester) defaultsFile() string {
}

func (m *mysqlTester) makeOptionFile() error {
tmp, err := ioutil.TempFile("", "optionfile")
tmp, err := os.CreateTemp("", "optionfile")
if err != nil {
return errors.Wrap(err, "failed to create option file")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (p *pgTester) pgEnv() []string {
}

func (p *pgTester) makePGPassFile() error {
tmp, err := ioutil.TempFile("", "pgpass")
tmp, err := os.CreateTemp("", "pgpass")
if err != nil {
return errors.Wrap(err, "failed to create option file")
}
Expand Down

0 comments on commit e14a9f9

Please sign in to comment.