On Sun, Oct 3, 2021 at 8:41 AM mi...@ubo.ro <mi...@ubo.ro> wrote:
>
> I have developed a library that depends very much on reflect package. It 
> caches a specific type and return a function that encodes(does something 
> with) with that kind /type of data. Think of defining database schema using 
> types and generating functions to validate/update/insert data.
>
> I reduced it to a basic example below. Can the generics feature from Go help 
> me make it any safer?  Ideally I would like to make the program below not to 
> compile due the errors of invalid params passed to PrintT instead  to  throw 
> dynamically at runtime.

I don't understand what your program is trying to do, but the current
generics proposal does not support variadic generic parameters, so I
don't think it's going to help you.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVMfXiCKvLSWX576NKkiAp8CoryoprQtxNzVjszET6tjA%40mail.gmail.com.

Reply via email to