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

> Yes, Type safe. You can not interpret something as a different kind of type via the use of interface{}.

Interesting; for some reason, I was under the impression that you could cast an `interface{}` arbitrarily, but from trying it out, you're absolutely correct. (I should definitely make sure to try these things out before confidently asserting about them...)

> interface{} is strictly better than void-pointers

No arguments here; even if for some reason they weren't type safe (which they are, much to my surprise), I'd still agree with you there.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: