type entities interface {
type User, Customer
}
type User struct {
ID int64
Name string
Email string
}
type Customer struct {
ID int64
Name string
Email string
}
func Insert[T entities](entry T) (T, error) {
}
Just like @christophberger said, the compiler reports a syntax error: syntax error: unexpected type, expecting method or embedded element. You can replace the type User, Customer within your entities with User | Costumer, but then you run into this https://github.com/golang/go/issues/48522