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

remove deprecated ioutil references #248

Merged

Conversation

RohitKochhar
Copy link
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
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.

cmd/root.go Show resolved Hide resolved
@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