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

go_modules: replace deprecated ioutil library #11541

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

dmitris
Copy link
Contributor

@dmitris dmitris commented Feb 11, 2025

What are you trying to accomplish?

Per golang/go#42026, the io/ioutil package has been deprecated since go1.16. Replace them with the standard invocation of os.MkdirTemp https://pkg.go.dev/os#MkdirTemp.

Anything you want to highlight for special attention from reviewers?

a trivial change in the native helper - Go importresolver

in importresolver/main.go:L32-L34, added the removal of the local file on function exit (to prevent "pollution" of the local filesystem) since TestVCSRemoteForImport returns only the repo.Remote() "portion" of repo and the local directory is not used.

How will you know you've accomplished your goal?

added a unit test go_modules/helpers/importresolver/main_test.go to test the function VCSRemoteForImport (to check for syntax errors etc.)

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@dmitris dmitris requested a review from a team as a code owner February 11, 2025 08:41
@github-actions github-actions bot added the L: go:modules Golang modules label Feb 11, 2025
@dmitris dmitris force-pushed the go-fix-ioutil branch 6 times, most recently from b46c8c9 to 6d3a124 Compare February 13, 2025 08:43
@dmitris dmitris force-pushed the go-fix-ioutil branch 2 times, most recently from f93ab45 to 866702c Compare February 13, 2025 21:10
Per golang/go#42026, io/ioutil
has been deprecated since go1.16. Replace them with
the standard invocation of os.MkdirTemp https://pkg.go.dev/os#MkdirTemp.
Add a new unit test for VCSRemoteForImport.
@amazimbe amazimbe merged commit 9f8f1d6 into dependabot:main Feb 14, 2025
47 checks passed
@dmitris dmitris deleted the go-fix-ioutil branch February 14, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: go:modules Golang modules
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants