As of Go 1.16, ioutil.ReadFile just calls os.ReadFile

This commit is contained in:
Andrew Field 2021-05-30 00:07:02 +03:00 committed by GitHub
parent 58e66a8103
commit a34e0d738a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,6 @@ import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
)
@ -24,7 +23,7 @@ func main() {
// Perhaps the most basic file reading task is
// slurping a file's entire contents into memory.
dat, err := ioutil.ReadFile("/tmp/dat")
dat, err := os.ReadFile("/tmp/dat")
check(err)
fmt.Print(string(dat))