-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Open
Description
The singleflight package's Group type uses string keys and interface{} values:
https://pkg.go.dev/golang.org/x/sync/singleflight#Group
I've locally forked it to add generics [K comparable, V any] but I'd like to get it upstream instead.
Proposal: add singleflight.TypedGroup[K, V] or singleflight.GenericGroup[K, V] or singleflight.GroupOf[K, V] behind a go1.18 build tag.
Do we have a convention yet on naming new parallel generic types alongside others?
Related: #47657 (for PoolOf, MapOf). (There was also talk of default type parameters so old code could instantiate types and get the old behavior (in this case [string, any]) and new callers could specify types?)
maisem, DeedleFake, elagergren-spideroak, artyom, catatsuy and 64 moremaisem, michaljurecko and nick-bisonai
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming