Skip to content

Commit b448156

Browse files
committed
Replace io/ioutil
It was deprecated in Go 1.16 and its functions moved elsewhere.
1 parent b79aa3e commit b448156

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: internal/main.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package main
1717
import (
1818
"flag"
1919
"fmt"
20-
"io/ioutil"
20+
"io"
2121
"os"
2222
"strings"
2323

@@ -42,7 +42,7 @@ func getMapping(fname string) map[string]string {
4242
if fname == "" {
4343
return m
4444
}
45-
data, err := ioutil.ReadFile(fname)
45+
data, err := os.ReadFile(fname)
4646
if err != nil {
4747
fail("Error reading %s: %v", fname, err)
4848
}
@@ -90,7 +90,7 @@ func main() {
9090
defer infile.Close()
9191
}
9292

93-
dataIn, err := ioutil.ReadAll(infile)
93+
dataIn, err := io.ReadAll(infile)
9494
if err != nil {
9595
fail("failed to read %s: %v", infile.Name(), err)
9696
}

0 commit comments

Comments
 (0)