5 ms·
If the interface check fails, does the code panic or does the `ok' value just get set to false? If `ok' gets set to false, that seems optimal. Pretty neat, in
by metadat 2y ago
If the interface check fails, does the code panic or does the `ok' value just get set to false?
If `ok' gets set to false, that seems optimal. Pretty neat, in fact, what other language permits such low-key, easy runtime interface checks?
- 38 2y agothis will panic: v := hello.(world) this never panic: v, ok := hello.(world) and yes, its awesome. people rag on Go because BLARG ERRORS BOILERPLATE, but if you can get over that Go is not Python/JavaScript, you're left with a simple powerful language