Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: panic(x) prints garbage if x is an integer other than 'int' #19658

Closed
alandonovan opened this issue Mar 22, 2017 · 2 comments

Comments

Projects
None yet
4 participants
@alandonovan
Copy link
Contributor

commented Mar 22, 2017

The statement panic(int(8)) causes a panic whose message starts with panic: 8. However, a panic operand of any other integer type causes output of the form panic: (uint) (0x999a0,0x1040a040), which suppresses the most crucial piece of information, the numeric value 8.

It would be more helpful it if printed panic: uint: 8.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2017

@bradfitz bradfitz added this to the Go1.9Maybe milestone Mar 22, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Apr 6, 2017

CL https://golang.org/cl/39650 mentions this issue.

@bradfitz bradfitz added the NeedsFix label Apr 9, 2017

@gopherbot gopherbot closed this in 0d33dc3 Apr 9, 2017

lparth added a commit to lparth/go that referenced this issue Apr 13, 2017

runtime: improve output of panic(x) where x is numeric
Fixes golang#19658

Change-Id: I41e46073b75c7674e2ed9d6a90ece367ce92166b
Reviewed-on: https://go-review.googlesource.com/39650
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>

@golang golang locked and limited conversation to collaborators Apr 9, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.