Commit f947c4dc authored by Darren Grant's avatar Darren Grant Committed by Robert Griesemer

builtin: spec correction for panic()

Upon unrecovered panic and program termination, process exit code is hard-coded
to 2, not set to the parameter passed to panic().

Change-Id: If64b75493227b4fd69c0bbb529f84e6df2d1b93f
Reviewed-on: https://go-review.googlesource.com/c/go/+/167709Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
parent cebc4e51
...@@ -226,10 +226,9 @@ func close(c chan<- Type) ...@@ -226,10 +226,9 @@ func close(c chan<- Type)
// invocation of F then behaves like a call to panic, terminating G's // invocation of F then behaves like a call to panic, terminating G's
// execution and running any deferred functions. This continues until all // execution and running any deferred functions. This continues until all
// functions in the executing goroutine have stopped, in reverse order. At // functions in the executing goroutine have stopped, in reverse order. At
// that point, the program is terminated and the error condition is reported, // that point, the program is terminated with a non-zero exit code. This
// including the value of the argument to panic. This termination sequence // termination sequence is called panicking and can be controlled by the
// is called panicking and can be controlled by the built-in function // built-in function recover.
// recover.
func panic(v interface{}) func panic(v interface{})
// The recover built-in function allows a program to manage behavior of a // The recover built-in function allows a program to manage behavior of a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment