Skip to content

Commit

Permalink
Remove use of deprecated ioutil.ReadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevan committed Jul 21, 2023
1 parent b4b70f2 commit 7cfbc09
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions collector/system_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package collector
import (
"bufio"
"bytes"
"io/ioutil"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -84,7 +83,7 @@ func (c *collector) getCPUs() {
}

func (c *collector) getLoadAvg() {
raw, err := ioutil.ReadFile("/proc/loadavg")
raw, err := os.ReadFile("/proc/loadavg")
if err != nil {
return
}
Expand All @@ -100,7 +99,7 @@ func (c *collector) getLoadAvg() {
}

func (c *collector) getMemory() {
raw, err := ioutil.ReadFile("/proc/meminfo")
raw, err := os.ReadFile("/proc/meminfo")
if err != nil {
return
}
Expand Down

0 comments on commit 7cfbc09

Please sign in to comment.