Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



i 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 :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: