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

Yeah, that's a perfectly valid solution as well. Depending on the application it may be faster to do the assertion on your type identifier rather than introspecting the type though. And having a list of type options more directly maps to a true sum type. I probably wouldn't actually do it in real Go code if I could avoid it though


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

Search: