From: Darren Grant Date: Thu, 14 Mar 2019 20:33:35 +0000 (-0400) Subject: builtin: spec correction for panic() X-Git-Tag: go1.13beta1~793 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f947c4dcfe6f22e6c92e6e5a170096b518a18448;p=gostls13.git 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/+/167709 Reviewed-by: Robert Griesemer --- diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go index 61ed6100b4..01190e9900 100644 --- a/src/builtin/builtin.go +++ b/src/builtin/builtin.go @@ -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