The io/ioutil package has been deprecated in Go 1.16 (See https://pkg.go.dev/io/ioutil). This PR replaces the existing io/ioutil functions with their new definitions in io and os packages.
ioutil.Discard => io.Discard
ioutil.NopCloser => io.NopCloser
ioutil.ReadAll => io.ReadAll
ioutil.ReadDir => os.ReadDir (returns a slice of os.DirEntry rather than a slice of fs.FileInfo, this may improve performance in some cases as os.ReadDir is more efficient [1])
The
io/ioutil
package has been deprecated in Go 1.16 (See https://pkg.go.dev/io/ioutil). This PR replaces the existingio/ioutil
functions with their new definitions inio
andos
packages.ioutil.Discard
=>io.Discard
ioutil.NopCloser
=>io.NopCloser
ioutil.ReadAll
=>io.ReadAll
ioutil.ReadDir
=>os.ReadDir
(returns a slice ofos.DirEntry
rather than a slice offs.FileInfo
, this may improve performance in some cases asos.ReadDir
is more efficient [1])ioutil.ReadFile
=>os.ReadFile
ioutil.TempDir
=>os.MkdirTemp
ioutil.TempFile
=>os.CreateTemp
ioutil.WriteFile
=>os.WriteFile