11/*
2- © Copyright IBM Corporation 2018, 2019
2+ © Copyright IBM Corporation 2018, 2023
33
44Licensed under the Apache License, Version 2.0 (the "License");
55you may not use this file except in compliance with the License.
@@ -18,7 +18,6 @@ package main
1818import (
1919 "context"
2020 "fmt"
21- "io/ioutil"
2221 "os"
2322 "strconv"
2423 "strings"
@@ -32,7 +31,7 @@ func TestMirrorLogWithoutRotation(t *testing.T) {
3231 for i := 0 ; i < 10 ; i ++ {
3332 t .Run (t .Name ()+ strconv .Itoa (i ), func (t * testing.T ) {
3433 // Use just the sub-test name in the file name
35- tmp , err := ioutil . TempFile ("" , strings .Split (t .Name (), "/" )[1 ])
34+ tmp , err := os . CreateTemp ("" , strings .Split (t .Name (), "/" )[1 ])
3635 if err != nil {
3736 t .Fatal (err )
3837 }
@@ -71,7 +70,7 @@ func TestMirrorLogWithRotation(t *testing.T) {
7170 for i := 0 ; i < 5 ; i ++ {
7271 t .Run (t .Name ()+ strconv .Itoa (i ), func (t * testing.T ) {
7372 // Use just the sub-test name in the file name
74- tmp , err := ioutil . TempFile ("" , strings .Split (t .Name (), "/" )[1 ])
73+ tmp , err := os . CreateTemp ("" , strings .Split (t .Name (), "/" )[1 ])
7574 if err != nil {
7675 t .Fatal (err )
7776 }
@@ -126,13 +125,13 @@ func TestMirrorLogWithRotation(t *testing.T) {
126125}
127126
128127func testMirrorLogExistingFile (t * testing.T , newQM bool ) int {
129- tmp , err := ioutil . TempFile ("" , t .Name ())
128+ tmp , err := os . CreateTemp ("" , t .Name ())
130129 if err != nil {
131130 t .Fatal (err )
132131 }
133132 t .Log (tmp .Name ())
134133 log .Println ("Logging 1 message before we start" )
135- ioutil .WriteFile (tmp .Name (), []byte ("{\" message\" =\" A\" }\n " ), 0600 )
134+ os .WriteFile (tmp .Name (), []byte ("{\" message\" =\" A\" }\n " ), 0600 )
136135 defer os .Remove (tmp .Name ())
137136 count := 0
138137 ctx , cancel := context .WithCancel (context .Background ())
0 commit comments