georgysavva / scany

Library for scanning data from a database into Go structs and more
MIT License
1.31k stars 68 forks source link

Prototype generic methods #138

Closed RangelReale closed 5 months ago

RangelReale commented 5 months ago

I created this PR with some prototype generic methods, so we don't need to pre-create the slices or output structs, which is done most of the times.

I just added functions with "Type" suffixes and a type parameter, this is not a final PR, just to open discussions about the viability and usefulness of it.

georgysavva commented 5 months ago

Hi, thank you for submitting this pull request. In my opinion, the benefits these methods provide don't justify the complication of the library's API

RangelReale commented 5 months ago

Yes I think so too, until Go have separate type parameters for struct methods, there's no way of doing a good generic API.