Skip to content

chore: Replace deprecated ioutil with os package#194

Open
Nepomuceno wants to merge 1 commit into
masterfrom
chore/replace-deprecated-ioutil
Open

chore: Replace deprecated ioutil with os package#194
Nepomuceno wants to merge 1 commit into
masterfrom
chore/replace-deprecated-ioutil

Conversation

@Nepomuceno

Copy link
Copy Markdown
Member

Summary

  • Replace deprecated io/ioutil functions with their os package equivalents as recommended since Go 1.16
  • ioutil.ReadDir -> os.ReadDir
  • ioutil.ReadFile -> os.ReadFile

Details

The io/ioutil package was deprecated in Go 1.16 (see release notes). This PR modernizes the codebase by using the recommended replacements from the os package.

Verification

This is a no-op change - the generated Terraform files (main.tf, outputs.tf) are identical before and after this change. The os.ReadDir function returns []os.DirEntry instead of []os.FileInfo, but both types have a Name() method, so the existing code works without modification.

Closes #188

Replace deprecated io/ioutil functions with their os package equivalents:
- ioutil.ReadDir -> os.ReadDir
- ioutil.ReadFile -> os.ReadFile

The ioutil package was deprecated in Go 1.16. This is a pure refactor
with no changes to generated Terraform files.

Closes #188
Copilot AI review requested due to automatic review settings December 29, 2025 22:28
@Nepomuceno Nepomuceno added this to the 0.5 milestone Dec 29, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the codebase by replacing deprecated io/ioutil package functions with their recommended os package equivalents, as per Go 1.16 guidelines. The changes are straightforward refactoring with no functional impact.

  • Removed the deprecated io/ioutil import
  • Replaced ioutil.ReadDir with os.ReadDir for reading template directory
  • Replaced two ioutil.ReadFile calls with os.ReadFile for reading JSON resource definitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modernize Go code - replace deprecated ioutil APIs

2 participants