This pull request focuses on simplifying the SingleflightGroup implementation by removing the generic key type and standardizing it to use strings. This change affects multiple files, including the main package, examples, and tests.
Key changes:
Simplification of SingleflightGroup:
singleflight.go: Modified SingleflightGroup to use string as the key type instead of a generic comparable type. Updated the Do method and NewSingleflightGroup function accordingly. [1][2][3]
Updates to examples and tests:
README.md: Updated example usage of SingleflightGroup to reflect the new key type. [1][2]
example_test.go: Adjusted the example to use the updated SingleflightGroup with string keys.
This pull request focuses on simplifying the
SingleflightGroup
implementation by removing the generic key type and standardizing it to use strings. This change affects multiple files, including the main package, examples, and tests.Key changes:
Simplification of
SingleflightGroup
:singleflight.go
: ModifiedSingleflightGroup
to usestring
as the key type instead of a generic comparable type. Updated theDo
method andNewSingleflightGroup
function accordingly. [1] [2] [3]Updates to examples and tests:
README.md
: Updated example usage ofSingleflightGroup
to reflect the new key type. [1] [2]example_test.go
: Adjusted the example to use the updatedSingleflightGroup
with string keys.singleflight_test.go
: Updated all test cases to use the newSingleflightGroup
with string keys. [1] [2] [3] [4] [5]