Migrate away from deprecated ioutil#490
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
56f78af to
407f195
Compare
|
@sebrandon1: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
ioutilhas been deprecated since Go 1.16: https://go.dev/doc/go1.16#ioutilTracking issue: redhat-best-practices-for-k8s/telco-bot#52
Migration from
ioutiltoospackage:File and directory operations:
Replaced all instances of
ioutil.ReadFile,ioutil.WriteFile, andioutil.ReadDirwithos.ReadFile,os.WriteFile, andos.ReadDirrespectively throughout the codebase, including files likecfg.go,scmauths.go,sshkey.go,common.go, and their associated test files. [1] [2] [3] [4] [5] [6] [7] [8] [9]Updated all usages of
ioutil.TempFileandioutil.TempDirtoos.CreateTempandos.MkdirTemprespectively, ensuring temporary files and directories are created using the recommended APIs. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]Imports and cleanup:
ioutilimports and replaced them with appropriateosimports in all affected files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]These changes ensure the project is compatible with newer Go versions and avoids deprecated functionality.