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 Dec 1, 2023
1 parent 32abaa6 commit 9348306
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions mksysconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ package main
import (
"fmt"
"go/format"
"io/ioutil"
"os"
"os/exec"
"regexp"
Expand Down Expand Up @@ -51,7 +50,7 @@ func gensysconf(in, out, goos, goarch string) error {
if err != nil {
return err
}
return ioutil.WriteFile(out, b, 0644)
return os.WriteFile(out, b, 0644)
}

func main() {
Expand Down
3 changes: 1 addition & 2 deletions sysconf_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package sysconf

import (
"bufio"
"io/ioutil"
"os"
"runtime"
"strconv"
Expand All @@ -26,7 +25,7 @@ const (
)

func readProcFsInt64(path string, fallback int64) int64 {
data, err := ioutil.ReadFile(path)
data, err := os.ReadFile(path)
if err != nil {
return fallback
}
Expand Down

0 comments on commit 9348306

Please sign in to comment.