f, err := os.Open("file.dat")
try errors.Wrap(err, "couldn't open file")


You approach has some merits to it. In addition to that some error handling 
solution needs to provide a way how to figure out what error happened, e.g. 
openening a file could fail because it does not exist or because of missing 
read permissions. How do you figure that out in a elegent way without 
lengthy if-then-else blocks?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1147a5ff-a2b9-493b-9162-bea0176fb84c%40googlegroups.com.

Reply via email to