Documentation ¶
Overview ¶
Basic example that demonstrates a type that doesn't implement an interface being flagged for a compile error when assigned to the interface.
Eli Bendersky [https://eli.thegreenplace.net] This code is in the public domain.
Check whether a type implements an interface at run-time, using a conversion to interface{} and a type assertion.
Eli Bendersky [https://eli.thegreenplace.net] This code is in the public domain.
Check whether a type implements an interface at run-time, using reflect.
Eli Bendersky [https://eli.thegreenplace.net] This code is in the public domain.
Click to show internal directories.
Click to hide internal directories.