Commit 9515610a authored by Danny Rosseau's avatar Danny Rosseau Committed by Rob Pike

encoding/gob: fix Debug to properly print uint

Fix debugger printing of uint that mistakenly
invoked .int64() instead of .uint64()

Fixes #21392

Change-Id: I107a7e87e0efbb06303c1e627dee76c369f75d1e
Reviewed-on: https://go-review.googlesource.com/54750Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
Reviewed-by: default avatarRob Pike <r@golang.org>
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 46aa9f54
...@@ -1321,6 +1321,7 @@ func TestUnexportedFields(t *testing.T) { ...@@ -1321,6 +1321,7 @@ func TestUnexportedFields(t *testing.T) {
var singletons = []interface{}{ var singletons = []interface{}{
true, true,
7, 7,
uint(10),
3.2, 3.2,
"hello", "hello",
[3]int{11, 22, 33}, [3]int{11, 22, 33},
......
...@@ -594,7 +594,7 @@ func (deb *debugger) printBuiltin(indent tab, id typeId) { ...@@ -594,7 +594,7 @@ func (deb *debugger) printBuiltin(indent tab, id typeId) {
x := deb.int64() x := deb.int64()
fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
case tUint: case tUint:
x := deb.int64() x := deb.uint64()
fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
case tFloat: case tFloat:
x := deb.uint64() x := deb.uint64()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment