I am playing with type assertion using the following dummy code, and I got the error:
cannot type switch on non-interface value
Doe
I figured out the answer, which is to cast n to interface{} before the type assertion:
n
interface{}
switch v := interface{}(n).(type)