3 ms·
You can also import the unsafe package and mess with pointers directly. Neither of these are problems. Go strikes a nearly perfect balance between saving the
by georgemcbay 14y ago
You can also import the unsafe package and mess with pointers directly. Neither of these are problems.
Go strikes a nearly perfect balance between saving the programmer from accidentally shooting his foot off and getting the hell out of the way when the programmer is absolutely sure that the proper solution involves bending the rules a bit.
- nickpresta 14y agoI never said these things were problems. I only brought them up because the article doesn't even mention them, or type safety at all. It is one thing to have code for an example or for an introductory paragraph, but it should be mentioned that `interface{}` is not totally "safe" .
- batista 14y agoI don't think so. A proper solution for generics would be a "nearly perfect balance" in this case, not reflection or casting.