Use if v, ok := thing.(type); ok { } idiom.