Skip to content
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

chore: address io/ioutil depreciation #361

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

tenthirtyam
Copy link
Collaborator

io/ioutil is deprecated as of Go 1.16:

  • Updates ioutil.Discard to io.Discard.
  • Updates ioutil.TempFile to os.CreateTemp.
  • Updates ioutil.ReadFile to os.ReadFile.
  • Updates ioutil.WriteFile to os.WriteFile.
packer-plugin-vsphere on  chore/ioutil-depreciation [!] via 🐹 v1.21.6 took 29.6s 
✦ ➜ make build

packer-plugin-vsphere on  chore/ioutil-depreciation [!] via 🐹 v1.21.6 took 8.7s 
✦ ➜ make test
?       github.com/hashicorp/packer-plugin-vsphere      [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/testing       [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/examples/driver      [no test files]
?       github.com/hashicorp/packer-plugin-vsphere/version      [no test files]
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone        3.255s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common       9.730s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver       8.574s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso  7.139s
ok      github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/supervisor   15.838s
ok      github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere       9.135s
ok      github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template      11.109s

`io/ioutil` is deprecated as of Go 1.16:

- Updates `ioutil.Discard` to `io.Discard`.
- Updates `ioutil.TempFile` to `os.CreateTemp`.
- Updates `ioutil.ReadFile` to `os.ReadFile`.
- Updates `ioutil.WriteFile` to `os.WriteFile`.

Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
@tenthirtyam tenthirtyam self-assigned this Jan 30, 2024
@tenthirtyam tenthirtyam requested a review from a team as a code owner January 30, 2024 21:54
Copy link
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

A quick rg into the repo confirms you removed all instances of ioutil usage, thanks @tenthirtyam

Merging now.

@lbajolet-hashicorp lbajolet-hashicorp merged commit c76697a into main Jan 30, 2024
12 checks passed
@lbajolet-hashicorp lbajolet-hashicorp deleted the chore/ioutil-depreciation branch January 30, 2024 22:02
@tenthirtyam tenthirtyam added this to the v1.2.5 milestone Mar 6, 2024
@hashicorp hashicorp locked and limited conversation to collaborators Jun 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants