]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: spec correction for panic()
authorDarren Grant <darren.e.grant@gmail.com>
Thu, 14 Mar 2019 20:33:35 +0000 (16:33 -0400)
committerRobert Griesemer <gri@golang.org>
Fri, 5 Apr 2019 00:52:55 +0000 (00:52 +0000)
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/+/167709
Reviewed-by: Robert Griesemer <gri@golang.org>
src/builtin/builtin.go

index 61ed6100b43f0381f03908abbd87682cbbe93a49..01190e99002d441da5a477fa9ec7c8f36a0df44b 100644 (file)
@@ -226,10 +226,9 @@ func close(c chan<- Type)
 // invocation of F then behaves like a call to panic, terminating G's
 // execution and running any deferred functions. This continues until all
 // functions in the executing goroutine have stopped, in reverse order. At
-// that point, the program is terminated and the error condition is reported,
-// including the value of the argument to panic. This termination sequence
-// is called panicking and can be controlled by the built-in function
-// recover.
+// that point, the program is terminated with a non-zero exit code. This
+// termination sequence is called panicking and can be controlled by the
+// built-in function recover.
 func panic(v interface{})
 
 // The recover built-in function allows a program to manage behavior of a