4 ms·
And implement that check in each and every function that has a receiver? That sounds like a recipe for bad performance (unnecessary branching), as well as unnec
by gher-shyu3i 6y ago
And implement that check in each and every function that has a receiver? That sounds like a recipe for bad performance (unnecessary branching), as well as unnecessary readability affects.
- pishpash 6y agoNot necessarily. It's suggested as a way to maintain the typing decision the original parent made, but which itself is undesirable. The pattern can be changed to, func main() { var c Compressor // signal do nothing DoCompress(c) c = &GZipComprosser{} // normal call DoCompress(c) }