tweaks
This commit is contained in:
parent
e721314b97
commit
fea62fe1ed
@ -14,7 +14,7 @@ func main() {
|
||||
// site designed to panic.
|
||||
panic("a problem")
|
||||
|
||||
// A common use of panic is to abort if function
|
||||
// A common use of panic is to abort if a function
|
||||
// returns an error value that we don't know how to
|
||||
// (or want to) handle. Here's an example of
|
||||
// `panic`king if we get an unexpected error when creating a new file.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Running the program will cause it to panic, print
|
||||
# Running this program will cause it to panic, print
|
||||
# an error message and goroutine traces, and exit with
|
||||
# a non-zero status.
|
||||
$ go run panic.go
|
||||
@ -13,4 +13,3 @@ exit status 2
|
||||
# Note that unlike some languages which use exceptions
|
||||
# for handling of many errors, in Go it is idiomatic
|
||||
# to use error-indicating return values wherever possible.
|
||||
# We'll learn more about this in later examples.
|
||||
|
Loading…
x
Reference in New Issue
Block a user