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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dmitris
Copy link

@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 2 times, most recently from c3f83d8 to d42a9a3 Compare February 11, 2025 17:29
Dmitry S added 2 commits February 11, 2025 19:16
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.
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
None yet
Development

Successfully merging this pull request may close these issues.

1 participant