-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace deprecated ioutil functions #298
Comments
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Is your feature request related to a problem?/Why is this needed
This project uses the
ioutil
package for the following functionsThe functions in ioutil have been deprecated in favour of similar functions in io and os. While some of these deprecated functions internally call the corresponding, recommended,
io
andos
functions, we could benefit by replacing these usages directly in the project code.Describe the solution you'd like in detail
Replace usages of deprecated functions on a case-by-case basis with functions in
os
andio
. The following command finds all files in theutils
project importing theioutils
package:grep -Rl "io/ioutil" .
and the result is
A simple MR replacing usages in these files with relevant (perhaps improved?) tests would be the solution. Almost all of the functions listed in the previous section have become wrappers around the newer functions. However,
ioutil.ReadDir
's replacementos.ReadDir
offers supposedly better efficiency and the return type changes fromfs.FileInfo
->fs.DirEntry
and it returns a partial result in the case of an error while reading the directory. These changes do not matter in the context of this project and a simple replacement will work with no additional changes.I've created a branch for this fix in my fork and
go test ./...
reports no errorsIf this issue gets triaged, I can create a pull request.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: