Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove refs to deprecated io/ioutil #465

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/event_processor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package event_processor
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/util/kernel/kernel_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package kernel

import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -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
}
Expand All @@ -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)
}
Expand Down
Loading