4
4
"database/sql"
5
5
"errors"
6
6
"fmt"
7
- "io/ioutil"
8
7
"net"
9
8
"os"
10
9
"os/user"
@@ -107,7 +106,7 @@ func Test_ErrorWhenUnableToInitDatabase(t *testing.T) {
107
106
jarFile , cleanUp := createTempXzArchive ()
108
107
defer cleanUp ()
109
108
110
- extractPath , err := ioutil . TempDir (filepath .Dir (jarFile ), "extract" )
109
+ extractPath , err := os . MkdirTemp (filepath .Dir (jarFile ), "extract" )
111
110
if err != nil {
112
111
panic (err )
113
112
}
@@ -143,7 +142,7 @@ func Test_ErrorWhenUnableToCreateDatabase(t *testing.T) {
143
142
144
143
defer cleanUp ()
145
144
146
- extractPath , err := ioutil . TempDir (filepath .Dir (jarFile ), "extract" )
145
+ extractPath , err := os . MkdirTemp (filepath .Dir (jarFile ), "extract" )
147
146
148
147
if err != nil {
149
148
panic (err )
@@ -214,7 +213,7 @@ func Test_ErrorWhenCannotStartPostgresProcess(t *testing.T) {
214
213
215
214
defer cleanUp ()
216
215
217
- extractPath , err := ioutil . TempDir (filepath .Dir (jarFile ), "extract" )
216
+ extractPath , err := os . MkdirTemp (filepath .Dir (jarFile ), "extract" )
218
217
if err != nil {
219
218
panic (err )
220
219
}
@@ -236,7 +235,7 @@ func Test_ErrorWhenCannotStartPostgresProcess(t *testing.T) {
236
235
}
237
236
238
237
func Test_CustomConfig (t * testing.T ) {
239
- tempDir , err := ioutil . TempDir ("" , "embedded_postgres_test" )
238
+ tempDir , err := os . MkdirTemp ("" , "embedded_postgres_test" )
240
239
if err != nil {
241
240
panic (err )
242
241
}
@@ -281,7 +280,7 @@ func Test_CustomConfig(t *testing.T) {
281
280
}
282
281
283
282
func Test_CustomLog (t * testing.T ) {
284
- tempDir , err := ioutil . TempDir ("" , "embedded_postgres_test" )
283
+ tempDir , err := os . MkdirTemp ("" , "embedded_postgres_test" )
285
284
if err != nil {
286
285
panic (err )
287
286
}
@@ -402,7 +401,7 @@ func Test_CanStartAndStopTwice(t *testing.T) {
402
401
}
403
402
404
403
func Test_ReuseData (t * testing.T ) {
405
- tempDir , err := ioutil . TempDir ("" , "embedded_postgres_test" )
404
+ tempDir , err := os . MkdirTemp ("" , "embedded_postgres_test" )
406
405
if err != nil {
407
406
panic (err )
408
407
}
@@ -480,7 +479,7 @@ func Test_ReuseData(t *testing.T) {
480
479
}
481
480
482
481
func Test_CustomBinariesRepo (t * testing.T ) {
483
- tempDir , err := ioutil . TempDir ("" , "embedded_postgres_test" )
482
+ tempDir , err := os . MkdirTemp ("" , "embedded_postgres_test" )
484
483
if err != nil {
485
484
panic (err )
486
485
}
@@ -526,7 +525,7 @@ func Test_CustomBinariesRepo(t *testing.T) {
526
525
}
527
526
528
527
func Test_CustomBinariesLocation (t * testing.T ) {
529
- tempDir , err := ioutil . TempDir ("" , "prepare_database_test" )
528
+ tempDir , err := os . MkdirTemp ("" , "prepare_database_test" )
530
529
if err != nil {
531
530
panic (err )
532
531
}
@@ -564,12 +563,12 @@ func Test_CustomBinariesLocation(t *testing.T) {
564
563
}
565
564
566
565
func Test_PrefetchedBinaries (t * testing.T ) {
567
- binTempDir , err := ioutil . TempDir ("" , "prepare_database_test_bin" )
566
+ binTempDir , err := os . MkdirTemp ("" , "prepare_database_test_bin" )
568
567
if err != nil {
569
568
panic (err )
570
569
}
571
570
572
- runtimeTempDir , err := ioutil . TempDir ("" , "prepare_database_test_runtime" )
571
+ runtimeTempDir , err := os . MkdirTemp ("" , "prepare_database_test_runtime" )
573
572
if err != nil {
574
573
panic (err )
575
574
}
@@ -616,7 +615,7 @@ func Test_PrefetchedBinaries(t *testing.T) {
616
615
}
617
616
618
617
func Test_RunningInParallel (t * testing.T ) {
619
- tempPath , err := ioutil . TempDir ("" , "parallel_tests_path" )
618
+ tempPath , err := os . MkdirTemp ("" , "parallel_tests_path" )
620
619
if err != nil {
621
620
panic (err )
622
621
}
0 commit comments