nspcc-dev / neofs-sdk-go

Go implementation of NeoFS SDK
Apache License 2.0
6 stars 14 forks source link

Try not to use `any` interface as a generalization #538

Open carpawell opened 10 months ago

carpawell commented 10 months ago

Is your feature request related to a problem? Please describe.

I'm always frustrated when I see any keyword when the code needs to do some common actions with the different structs. We have generics for that for more than 1.5 years already. One of such funcs is signing and verification. They are the hot ones in an average NeoFS application so even a small optimization can be good.

Describe the solution you'd like

Try to use generics here. I am not sure it is really possible but still we can try it. Do some benchmarks (but even if the outcome is not that good, I would always prefer a generic version over the any one).

Describe alternatives you've considered

Do nothing.