no generic ?

249 views
Skip to first unread message

alex-coder

unread,
Feb 21, 2021, 4:02:24 PM2/21/21
to golang-nuts
Hi all !
I'm just a beginner in Golang and I see a discussion in regards to introduce generics into Go.
But is it possible to provide an example where it is impossible to use interface instead of generic ?
Thank you in advance.

Ian Lance Taylor

unread,
Feb 21, 2021, 4:03:56 PM2/21/21
to alex-coder, golang-nuts
On Sun, Feb 21, 2021 at 1:02 PM alex-coder <a.gus...@gmail.com> wrote:
>
> I'm just a beginner in Golang and I see a discussion in regards to introduce generics into Go.
> But is it possible to provide an example where it is impossible to use interface instead of generic ?

Please see https://blog.golang.org/why-generics.

Ian

Steven Hartland

unread,
Feb 22, 2021, 4:04:45 AM2/22/21
to alex-coder, golang-nuts
The proposal to add generics to go has been accepted and it is due to be added in v1.18

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e0139450-f753-4921-ba6f-fd0b252c525cn%40googlegroups.com.

alex-coder

unread,
Feb 24, 2021, 2:47:16 AM2/24/21
to golang-nuts
Hello,
thank you very much for clarification.
I'm just a  beginner and come here to understand rationale behind the decision.

Thank you so much !
Reply all
Reply to author
Forward
0 new messages