Skip to content

robustio: add package#203

Closed
eandre wants to merge 1 commit intorogpeppe:masterfrom
eandre:robustio
Closed

robustio: add package#203
eandre wants to merge 1 commit intorogpeppe:masterfrom
eandre:robustio

Conversation

@eandre
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants