mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-03-02 01:30:26 +00:00
chore: remove refs to deprecated io/ioutil
This commit is contained in:
@@ -18,7 +18,7 @@ package systemlogmonitor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
@@ -62,7 +62,7 @@ func NewLogMonitorOrDie(configPath string) types.Monitor {
|
||||
tomb: tomb.NewTomb(),
|
||||
}
|
||||
|
||||
f, err := ioutil.ReadFile(configPath)
|
||||
f, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed to read configuration file %q: %v", configPath, err)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package filelog
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -139,7 +138,7 @@ Jan 2 03:04:05 kernel: [2.000000] 3
|
||||
}
|
||||
for c, test := range testCases {
|
||||
t.Logf("TestCase #%d: %#v", c+1, test)
|
||||
f, err := ioutil.TempFile("", "log_watcher_test")
|
||||
f, err := os.CreateTemp("", "log_watcher_test")
|
||||
assert.NoError(t, err)
|
||||
defer func() {
|
||||
f.Close()
|
||||
|
||||
Reference in New Issue
Block a user