4 ms·
Stealing this pattern. Thank you.
by chessturk 8y ago
Stealing this pattern. Thank you.
- Insanity 8y agoYeah me too! But I wonder how it'll hold up in some actual code scenarios where not everything is chained neatly in a function. And I could rewrite that, but that might be worse. If you want to do something with the intermediate results (e.g, the functions return more than just error) this will not be possible.. resourceName, err := connection.getName() if err != nil { // handle } fst := strings.Split(resourceName, ".")[0] sendTime, err := connection.findSendtime(fst) if err != nil { // handle } // do something with sendtime and call new func.. you get the point EDIT: Fix some mistakes in my example code. Obviously fake example though :)