diff --git a/pkg/event_processor/processor_test.go b/pkg/event_processor/processor_test.go index 536a3cd14..de69604c1 100644 --- a/pkg/event_processor/processor_test.go +++ b/pkg/event_processor/processor_test.go @@ -3,8 +3,8 @@ package event_processor import ( "encoding/json" "fmt" - "io/ioutil" "log" + "os" "strings" "testing" "time" @@ -42,7 +42,7 @@ func TestEventProcessor_Serve(t *testing.T) { go func() { ep.Serve() }() - content, err := ioutil.ReadFile(testFile) + content, err := os.ReadFile(testFile) if err != nil { //Do something log.Fatalf("open file error: %s, file:%s", err.Error(), testFile) @@ -59,7 +59,7 @@ func TestEventProcessor_Serve(t *testing.T) { t.Fatalf("json unmarshal error: %s, body:%v", err.Error(), line) } payloadFile := fmt.Sprintf("testdata/%d.bin", eventSSL.Timestamp) - b, e := ioutil.ReadFile(payloadFile) + b, e := os.ReadFile(payloadFile) if e != nil { t.Fatalf("read payload file error: %s, file:%s", e.Error(), payloadFile) } diff --git a/pkg/util/kernel/kernel_version.go b/pkg/util/kernel/kernel_version.go index ddfb76e4c..ea040a99d 100644 --- a/pkg/util/kernel/kernel_version.go +++ b/pkg/util/kernel/kernel_version.go @@ -19,7 +19,7 @@ package kernel import ( "fmt" - "io/ioutil" + "os" "regexp" "strconv" "strings" @@ -73,7 +73,7 @@ func currentVersionUname() (uint32, error) { } func currentVersionUbuntu() (uint32, error) { - procVersion, err := ioutil.ReadFile("/proc/version_signature") + procVersion, err := os.ReadFile("/proc/version_signature") if err != nil { return 0, err } @@ -100,7 +100,7 @@ func parseDebianVersion(str string) (uint32, error) { } func currentVersionDebian() (uint32, error) { - procVersion, err := ioutil.ReadFile("/proc/version") + procVersion, err := os.ReadFile("/proc/version") if err != nil { return 0, fmt.Errorf("error reading /proc/version: %s", err) }