Type Switches
A type switch compares types instead of values. You
can use this to discover the type of an interface
value. In this example, the variable t will have the
type corresponding to its clause.
A type switch compares types instead of values. You
can use this to discover the type of an interface
value. In this example, the variable t will have the
type corresponding to its clause.