Skip to content

remove deprecated ioutil references#248

Merged
sudermanjr merged 1 commit intoFairwindsOps:masterfrom
RohitKochhar:remove_ioutil_references
Aug 28, 2023
Merged

remove deprecated ioutil references#248
sudermanjr merged 1 commit intoFairwindsOps:masterfrom
RohitKochhar:remove_ioutil_references

Conversation

@RohitKochhar
Copy link
Copy Markdown
Contributor

This PR fixes the use of the now depracted ioutil package, replacing functions it provided with the according os or io functions.

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation (not needed)

Description

What's the goal of this PR?

To remove any references to ioutil while ensuring the functionality that it provided is still in place with the newer alternatives.

What changes did you make?

Changed all references as follows:

  • ioutil.TempFile -> os.CreateTemp
  • ioutil.ReadFile -> os.ReadFile
  • ioutil.ReadAll -> io.ReadAll
  • ioutil.WriteFile -> os.WriteFile

Also changed a capitalized fmt.Errorf message as per Go convention.

What alternative solution should we consider, if any?

  • Since the library is deprecated, if this change is omitted, there will eventually be issues with compatibility with newer versions of go.

Copy link
Copy Markdown
Member

@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! LGTM, but we'll need a codeowner review.

@sudermanjr sudermanjr changed the title removed depracted ioutil references removed deprecated ioutil references Aug 28, 2023
@sudermanjr sudermanjr changed the title removed deprecated ioutil references remove deprecated ioutil references Aug 28, 2023
@sudermanjr sudermanjr enabled auto-merge (squash) August 28, 2023 19:47
@sudermanjr sudermanjr merged commit 060af02 into FairwindsOps:master Aug 28, 2023
@RohitKochhar RohitKochhar deleted the remove_ioutil_references branch August 29, 2023 11:39
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.

4 participants