Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Why Go Is Not Good (2014). Parent comment
Sidenote, you may or may not have meant a panic - so i just want to clarify.
Casting an interface to a type incorrectly will not cause a panic/crash, assuming you use the proper syntax.
// Will panic foo := myInterface.(BadType) // Will not panic foo, ok := myInterface.(BadType)
There are no comments on this comment yet.
Sidenote, you may or may not have meant a panic - so i just want to clarify.
Casting an interface to a type incorrectly will not cause a panic/crash, assuming you use the proper syntax.
In the latter, you simply check if `ok` is true or not. If not, the interface value does not implement the given type/interface.