希望所有類型能滿足同名同參無返回值方法的接口。

如下,T1T2T3應滿足接口I

type I interface {
    F1()
}

type T1 struct {...}
func (t T1) F1() int {...}

type T2 struct {...}
func (t T2) F1() float32 {...}

type T3 struct {...}
func (t T3) F1() (T1, error) {...}

Ok, so I helped myself with Google Translate:

We want all types to satisfy an interface that has a method with the same name, parameters, and no return value.
For example, T1, T2, and T3 should satisfy interface I.

Well, that isn’t going to work because F1 for each type has a different return value. I don’t think even this would work:

type I interface {
	F1() any
}

because (T1, error) are two values so T3.F1’s return value doesn’t match any.