972df38445
Make panics more useful by printing values, if their underlying kind is printable, instead of just their memory address. Thus now given any custom type derived from any of: float*, int*, string, uint* if we have panic with such a result, its value will be printed. Thus given any of: type MyComplex128 complex128 type MyFloat64 float64 type MyString string type MyUintptr uintptr panic(MyComplex128(32.1 + 10i)) panic(MyFloat64(-93.7)) panic(MyString("This one")) panic(MyUintptr(93)) They will now print in the panic: panic: main.MyComplex64(+1.100000e-001+3.000000e+000i) panic: main.MyFloat64(-9.370000e+001) panic: main.MyString("This one") panic: main.MyUintptr(93) instead of: panic: (main.MyComplex128) (0xe0100,0x138cc0) panic: (main.MyFloat64) (0xe0100,0x138068) panic: (main.MyString) (0x48aa00,0x4c0840) panic: (main.MyUintptr) (0xe0100,0x137e58) and anything else will be printed as in the past with: panic: (main.MyStruct) (0xe4ee0,0x40a0e0) Also while here, updated the Go1.15 release notes. Fixes #37531 Change-Id: Ia486424344a386014f2869ab3483e42a9ef48ac4 Reviewed-on: https://go-review.googlesource.com/c/go/+/221779 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.