Golang call another class

Hi @mduzoylum, welcome to the forum.

If the parameter can take only a fixed number of known types, you can use a type switch:

switch v := i.(type) {
case T:
    // here v has type T
case S:
    // here v has type S
default:
    // no match; here v has the same type as i
}
1 Like