Is it possible to embed generic structs with go2go?

132 views
Skip to first unread message

Kristian Aadalen

unread,
Feb 9, 2021, 2:05:23 PM2/9/21
to golang-nuts
First of all, I hope this is an appropriate place to ask this question, please let me know if it's not.

I wonder if it is possible to use composition and embed a generic struct (with go2go of course)?

I wan’t to do something like this, where I try to embed a generic struct to another generic struct: https://go2goplay.golang.org/p/5SPrFG55PFW

A non-generic version of this might be like this: https://go2goplay.golang.org/p/0oMJzsSoDo5


I am not very familiar to this new generic aspect in Go, so it might be that I am doing it wrong? Or is it maybe impossible to embed a generic struct?

Thanks!


Carla Pfaff

unread,
Feb 9, 2021, 2:40:58 PM2/9/21
to golang-nuts

Kristian Aadalen

unread,
Feb 10, 2021, 2:19:33 AM2/10/21
to golang-nuts
Aha. Thanks a lot!
Reply all
Reply to author
Forward
0 new messages