cloudpods
cloudpods copied to clipboard
refactor: move from io/ioutil to io and os packages
What this PR does / why we need it:
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.Discardioutil.NopCloser=>io.NopCloserioutil.ReadAll=>io.ReadAllioutil.ReadDir=>os.ReadDir(returns a slice ofos.DirEntryrather than a slice offs.FileInfo, this may improve performance in some cases asos.ReadDiris more efficient [1])ioutil.ReadFile=>os.ReadFileioutil.TempDir=>os.MkdirTempioutil.TempFile=>os.CreateTempioutil.WriteFile=>os.WriteFile
Does this PR need to be backport to the previous release branch?:
NONE