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

robustio: add package #203

Closed
wants to merge 1 commit into from
Closed

robustio: add package #203

wants to merge 1 commit into from

Conversation

eandre
Copy link

@eandre eandre commented Feb 15, 2023

This adds the robustio package from golang.org/x/tools/internal/robustio which in turn is copied from cmd/go/internal/robustio.

It would be great to add this to go-internal as we've sort of been standardizing on this repo for a lot of go-internal utility packages. I could of course maintain this myself but I hope you consider it for inclusion. The errors it "fixes" (papers over) are quite common when dealing with temporary files on Windows.

Taken from x/tools as of 268cb0b82f51be725f8ec432c155a92075cd54c6.
@mvdan
Copy link
Collaborator

mvdan commented Mar 27, 2023

Historically we've only copied packages from Go's main repository, not x/tools, so I would lean towards including https://pkg.go.dev/cmd/go/internal/robustio instead of https://pkg.go.dev/golang.org/x/tools/internal/robustio.

Also note that the x/tools API is slightly larger, with https://pkg.go.dev/golang.org/x/tools/internal/robustio#GetFileID. I would argue that not including that is a good thing, as it seems like an opaque and low level API that doesn't seem useful on its own.

Copy link
Collaborator

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Marking as "changes requested" to remind myself :)

@rogpeppe
Copy link
Owner

Superceded by #239 (thanks for the suggestion @eandre!)

@rogpeppe rogpeppe closed this Dec 13, 2023
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.

None yet

3 participants