Move to Go 1.19, remote io/util, fix data race and a flapper

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2022-08-05 09:55:37 -06:00
parent be54b08afd
commit 3c9a7cc6e5
50 changed files with 294 additions and 304 deletions

View File

@@ -16,7 +16,6 @@ package pse
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"sync/atomic"
"syscall"
@@ -48,7 +47,7 @@ func init() {
// Sampling function to keep pcpu relevant.
func periodic() {
contents, err := ioutil.ReadFile(procStatFile)
contents, err := os.ReadFile(procStatFile)
if err != nil {
return
}
@@ -88,7 +87,7 @@ func periodic() {
// ProcUsage returns CPU usage
func ProcUsage(pcpu *float64, rss, vss *int64) error {
contents, err := ioutil.ReadFile(procStatFile)
contents, err := os.ReadFile(procStatFile)
if err != nil {
return err
}