Error checking in examples/reading-files #123

Open
wants to merge 1 commit into
from

1 participant

@calmh

This improves the error checking in in this example by clarifying that
the check() pattern should be limited to the top level of command line
programs, avoiding the full panic backtrace, and checking the return of
close() at the end. I think this better reflects current practices,
although I'm tempted to remove the check() function at all and provide
more useful error messages at each exit point - although this may make
the example too cluttered.

(I think I got it right with the formatting and hash thing, although
this was a slight fight against my editor - why not standardize on
gofmt:ed code like the rest of the Go universe? ;)

@calmh calmh Error checking in examples/reading-files
This improves the error checking in in this example by clarifying that
the check() pattern should be limited to the top level of command line
programs, avoiding the full panic backtrace, and checking the return of
close() at the end. I think this better reflects current practices,
although I'm tempted to remove the check() function at all and provide
more useful error messages at each exit point - although this may make
the example too cluttered.

(I think I got it right with the formatting and hash thing, although
this was a slight fight against my editor - why not standardize on
gofmt:ed code like the rest of the Go universe? ;)
a927119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment