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

internal/singleflight: delete, use golang.org/x/sync/singleflight #31697

Open
bradfitz opened this issue Apr 26, 2019 · 5 comments
Open

internal/singleflight: delete, use golang.org/x/sync/singleflight #31697

bradfitz opened this issue Apr 26, 2019 · 5 comments

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Apr 26, 2019

The singleflight package started life in internal/singleflight and then moved to golang.org/x/sync/singleflight, and the two have had slightly divergent development histories since. It's getting kinda messy. Their APIs have even somewhat diverged.

I just tried to re-unify them and delete internal/singleflight from std, but we can't use mod/vendor packages during bootstrap.

/cc @ianlancetaylor

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 26, 2019

Change https://golang.org/cl/174080 mentions this issue: src/vendor: add golang.org/x/sync/singleflight, delete internal/singleflight

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Apr 29, 2019

Another step to re-unify them is:

I vote for 1st point, 2nd point will break current user of golang.org/x/sync/singleflight out there. How do you think @bradfitz ?

Loading

@bradfitz
Copy link
Contributor Author

@bradfitz bradfitz commented Apr 29, 2019

We can't break (change) the x/sync/singleflight public API.

We can add a new method, though.

Loading

@tarndt
Copy link

@tarndt tarndt commented Apr 30, 2019

If github.com/golang/sync another fork or is that just a clone of golang.org/x/sync? I've been unsure which should be imported.

Loading

@cuonglm
Copy link
Member

@cuonglm cuonglm commented Apr 30, 2019

@tarndt Use golang.org/x/sync, it's custom import path for github.com/golang/sync https://github.com/golang/sync/blob/master/singleflight/singleflight.go#L7

Loading

@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants