Skip to content

Commit 9515610

Browse files
Danny Rosseaurobpike
Danny Rosseau
authored andcommitted
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/54750 Reviewed-by: Emmanuel Odeke <[email protected]> Reviewed-by: Rob Pike <[email protected]> Run-TryBot: Emmanuel Odeke <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 46aa9f5 commit 9515610

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/encoding/gob/codec_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,7 @@ func TestUnexportedFields(t *testing.T) {
13211321
var singletons = []interface{}{
13221322
true,
13231323
7,
1324+
uint(10),
13241325
3.2,
13251326
"hello",
13261327
[3]int{11, 22, 33},

src/encoding/gob/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ func (deb *debugger) printBuiltin(indent tab, id typeId) {
594594
x := deb.int64()
595595
fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
596596
case tUint:
597-
x := deb.int64()
597+
x := deb.uint64()
598598
fmt.Fprintf(os.Stderr, "%s%d\n", indent, x)
599599
case tFloat:
600600
x := deb.uint64()

0 commit comments

Comments
 (0)