You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This just bit me. I had assumed (without looking into it too much) that
if you do,
if x, ok := x.(reflect.ArrayOrSliceType); ok {
}
then the type of x would be one of *reflect.ArrayType or *reflect.SliceType
within the body of the if.
This is not the case. The interface is also implemented by
*MapType, *PtrType and *ChanType.
Perhaps it might be worth considering making the interface
a little more exclusive to help in avoiding this pitfall.