3 ms·
In your more idiomatic version, you actually went ahead and changed the declaration of words to be []interface{}, but you may not be in control of the type of w
by gnuvince 14y ago
In your more idiomatic version, you actually went ahead and changed the declaration of words to be []interface{}, but you may not be in control of the type of words (for instance if it's the return value of a function). This is why I did the explicit conversion. As for the reflection, it's pretty ugly.
Also, what about semi-colons?
- f2f 14y agoi understand why you did the explicit conversion, the idea i was trying to relay is why i undid it... nevermind the semicolons, 'twas a joke :)