3 ms·
> Edit: note on the last Java example: an if statement with instanceof look prettier ;). Sure, and an if or switch on .(type) in go probably looks better as we
by masklinn 13y ago
> Edit: note on the last Java example: an if statement with instanceof look prettier ;).
Sure, and an if or switch on .(type) in go probably looks better as well.
- hornetblack 13y ago> switch on .(type) For anyone wondering switch val := heap.Pop(key).(type) { case (*MyType): // We're all good default: // Didn't get a (*MyType) }