I don't think so.
https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-way-to-express-convertibility
Ian
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
package main
type A interface {
Ma()
}
type B interface {
Mb()
}
type Ta struct { A }
type Tb struct { B }
func ConvertSliceToA[From A](vs []From) []A {
var r = make([]A, len(vs))
for i := range vs {
r[i] = vs[i]
}
return r
}