Open ndtretyak opened 1 year ago
We have discussed how generics can make the Go SDK API more type safe. We plan to provide a sample showing how the Go SDK could be wrapped using generics, but we do not plan to add it to the SDK at this time. If the sample receives sufficient interest me may consider graduating it into the SDK in some form, but that is TBD.
Is your feature request related to a problem? Please describe. Currently, there are a lot of interfaces and functions (e.g., side effects and channels) accepting or returning
interface{}
. I believe that with generics, it is possible to provideTyped
equivalents for these interfaces, enhancing type safety.Describe the solution you'd like For instance, a side effect could take a typed function
f
and returnf()
directly instead of someconverter.EncodedValue
Describe alternatives you've considered Implement these typed interfaces in my own code.