Given there's a generic interface:
type Packet interface { Content() int } type Recycler[T any] interface { Get() *T }and their implementation:
type packet struct { content int } type BaseRecycler[T any] struct { t T }its impossible to convert the implementation to the interface:
r := &BaseRecycler[packet]{} r1 := r.(Recycler[Packet]) fmt.Println(r3.Get().Content()) // compile error: Unresolved reference 'Content'here is a live code example: https://go.dev/play/p/qbnYfyDd22A
The error is because the Packet interface align with the *packet instead of packet. Could anyone suggest how to handle this?