With Go generics, it is not permitted to check whether a value whose type comes from a type parameter satisfies some optional interface. For example, the following code will not compile (as of Go 1.20):
type Q interface{ Q() }
func G[T any](t T) {
if q, ok := t.(Q); ok {
q.Q()