Skip to content

Commit

Permalink
chore: remove refs to deprecated io/ioutil (#116)
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <[email protected]>
  • Loading branch information
testwill authored Mar 14, 2024
1 parent bbc52a9 commit a87fc85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"compress/flate"
"errors"
"io/ioutil"
"log/syslog"
"net"
"os"
Expand Down Expand Up @@ -588,7 +587,7 @@ func (t *noopWriter) Write(a []byte) (int, error) {

func createTempFile(t *testing.T, name string, contents string) string {
file := os.TempDir() + string(os.PathSeparator) + "go-audit." + name
if err := ioutil.WriteFile(file, []byte(contents), os.FileMode(0644)); err != nil {
if err := os.WriteFile(file, []byte(contents), os.FileMode(0644)); err != nil {
t.Fatal("Failed to create temp file", err)
}
return file
Expand Down
4 changes: 2 additions & 2 deletions extras_containers_capsule8.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"bytes"
"crypto/sha256"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
)
Expand Down Expand Up @@ -68,7 +68,7 @@ func processContainerID(pid int) (string, error) {
// TaskControlGroups returns the cgroup membership of the specified task.
func taskControlGroups(tgid, pid int) ([]controlGroup, error) {
filename := fmt.Sprintf("/proc/%d/task/%d/cgroup", tgid, pid)
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit a87fc85

Please sign in to comment.