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

io/ioutil: TempDir and TempFile don't mention new os alternatives #44311

Closed
danp opened this issue Feb 16, 2021 · 3 comments
Closed

io/ioutil: TempDir and TempFile don't mention new os alternatives #44311

danp opened this issue Feb 16, 2021 · 3 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@danp
Copy link
Contributor

danp commented Feb 16, 2021

With the 1.16 release, all the functions in io/ioutil reference a new alternative in the os package except for TempDir and TempFile. This can make it easy to miss that os.CreateTemp and os.MkdirTemp were added to replace them.

TempDir and TempFile should probably mention their new os alternatives.

@danp
Copy link
Contributor Author

danp commented Feb 16, 2021

One way to fix this: have TempDir and TempFile call their new os alternatives and add a note to that effect, similar to ReadAll.

Looking at #42026 and https://golang.org/cl/266364, I'm not sure why TempDir and TempFile were not changed in that way when ReadAll and others were. If that would work, I'm happy to do that.

@ianlancetaylor
Copy link
Contributor

https://golang.org/cl/285378 makes this change, but it didn't make it into the 1.16 release.

@gopherbot
Copy link

Change https://golang.org/cl/285378 mentions this issue: io/ioutil: forward TempFile and TempDir to os package

@toothrot toothrot added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 17, 2021
@toothrot toothrot added this to the Backlog milestone Feb 17, 2021
@golang golang locked and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants