Skip to content

Commit

Permalink
Drop use of deprecated io/ioutil package
Browse files Browse the repository at this point in the history
It's deprecated as of Go 1.16.
  • Loading branch information
tklauser committed Nov 30, 2023
1 parent 32d39fd commit d7c67e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions numcpus_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package numcpus

import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand All @@ -35,7 +34,7 @@ func getFromCPUAffinity() (int, error) {
}

func readCPURange(file string) (int, error) {
buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, file))
buf, err := os.ReadFile(filepath.Join(sysfsCPUBasePath, file))
if err != nil {
return 0, err
}
Expand Down Expand Up @@ -89,7 +88,7 @@ func getConfigured() (int, error) {
}

func getKernelMax() (int, error) {
buf, err := ioutil.ReadFile(filepath.Join(sysfsCPUBasePath, "kernel_max"))
buf, err := os.ReadFile(filepath.Join(sysfsCPUBasePath, "kernel_max"))
if err != nil {
return 0, err
}
Expand Down

0 comments on commit d7c67e4

Please sign in to comment.