chore: io/ioutil has been deprecated

This commit is contained in:
Christian Schwarz
2024-09-08 13:15:26 +00:00
parent 48c5b60024
commit 740ab4b1b2
9 changed files with 11 additions and 20 deletions
+1 -2
View File
@@ -3,7 +3,6 @@ package zfs
import (
"errors"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
@@ -20,7 +19,7 @@ func getPipeCapacityHint(envvar string) int {
// https://github.com/zrepl/zrepl/issues/424#issuecomment-800370928
// https://bugzilla.kernel.org/show_bug.cgi?id=212295
if _, err := os.Stat("/proc/sys/fs/pipe-max-size"); err == nil {
if dat, err := ioutil.ReadFile("/proc/sys/fs/pipe-max-size"); err == nil {
if dat, err := os.ReadFile("/proc/sys/fs/pipe-max-size"); err == nil {
if capacity, err = strconv.ParseInt(strings.TrimSpace(string(dat)), 10, 64); err != nil {
capacity = 1 << 25
}