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

Comments

@bradfitz
Copy link
Member

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

@bradfitz bradfitz added this to the Go1.13 milestone Apr 26, 2019

@gopherbot

This comment has been minimized.

Copy link

commented Apr 26, 2019

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

@cuonglm

This comment has been minimized.

Copy link
Contributor

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 ?

@bradfitz

This comment has been minimized.

Copy link
Member Author

commented Apr 29, 2019

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

We can add a new method, though.

@tarndt

This comment has been minimized.

Copy link

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.

@cuonglm

This comment has been minimized.

Copy link
Contributor

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

@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.