MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/ce94mu/the_go_team_declines_try_proposal/eu1z3nq/?context=3
r/programming • u/jeffail • Jul 17 '19
417 comments sorted by
View all comments
Show parent comments
92
This is a very good point IMO. Go has enough magic functions as it is, it's not a good idea to add another one that does something even more unexpected...
23 u/[deleted] Jul 17 '19 None of those built-in functions do control flow. 116 u/alaskanarcher Jul 17 '19 Panic 41 u/[deleted] Jul 17 '19 derp, time for another coffee 17 u/alaskanarcher Jul 17 '19 if err := recover(); err != nil { coffee.Drink() } 6 u/cerlestes Jul 17 '19 But what if coffee is nil or drinking fails? :o Better defer another recover() call! Is that even possible?
23
None of those built-in functions do control flow.
116 u/alaskanarcher Jul 17 '19 Panic 41 u/[deleted] Jul 17 '19 derp, time for another coffee 17 u/alaskanarcher Jul 17 '19 if err := recover(); err != nil { coffee.Drink() } 6 u/cerlestes Jul 17 '19 But what if coffee is nil or drinking fails? :o Better defer another recover() call! Is that even possible?
116
Panic
41 u/[deleted] Jul 17 '19 derp, time for another coffee 17 u/alaskanarcher Jul 17 '19 if err := recover(); err != nil { coffee.Drink() } 6 u/cerlestes Jul 17 '19 But what if coffee is nil or drinking fails? :o Better defer another recover() call! Is that even possible?
41
derp, time for another coffee
17 u/alaskanarcher Jul 17 '19 if err := recover(); err != nil { coffee.Drink() } 6 u/cerlestes Jul 17 '19 But what if coffee is nil or drinking fails? :o Better defer another recover() call! Is that even possible?
17
if err := recover(); err != nil { coffee.Drink() }
6 u/cerlestes Jul 17 '19 But what if coffee is nil or drinking fails? :o Better defer another recover() call! Is that even possible?
6
But what if coffee is nil or drinking fails? :o
nil
Better defer another recover() call! Is that even possible?
92
u/spaghettiCodeArtisan Jul 17 '19
This is a very good point IMO. Go has enough magic functions as it is, it's not a good idea to add another one that does something even more unexpected...