mirror of
https://github.com/golang/go
synced 2024-11-23 00:30:07 -07:00
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> |
||
---|---|---|
.. | ||
articles | ||
codewalk | ||
gopher | ||
play | ||
progs | ||
asm.html | ||
cmd.html | ||
contrib.html | ||
contribute.html | ||
debugging_with_gdb.html | ||
diagnostics.html | ||
editors.html | ||
effective_go.html | ||
gccgo_contribute.html | ||
gccgo_install.html | ||
go1.1.html | ||
go1.2.html | ||
go1.3.html | ||
go1.4.html | ||
go1.5.html | ||
go1.6.html | ||
go1.7.html | ||
go1.8.html | ||
go1.9.html | ||
go1.10.html | ||
go1.11.html | ||
go1.12.html | ||
go1.13.html | ||
go1.14.html | ||
go1.15.html | ||
go1.html | ||
go1compat.html | ||
go_faq.html | ||
go_mem.html | ||
go_spec.html | ||
go-logo-black.png | ||
go-logo-blue.png | ||
go-logo-white.png | ||
help.html | ||
ie.css | ||
install-source.html | ||
install.html | ||
share.png | ||
tos.html |