Looking at the last line there ".Number(..."
Is it possible to discern the arguments to the method Number()
from those hex numbers?
It would be a help, without hitting the debugger too often.
panic: runtime error: index out of range
goroutine 19 [running]:
testing.tRunner.func1(0xc042046340)
C:/Go/src/testing/testing.go:622 +0x2a4
panic(0x523e20, 0x5df810)
C:/Go/src/runtime/panic.go:489 +0x2dd
util.(*NumberEngine).Number(0xc042066150, 0xf4698, 0xa, 0xc042b2a870, 0xa)
edit: including the full signature of method
func (fe *NumberEngine) Number(num int) Number {
edit: including the definition of Number
type Power struct{ Prime, Exp int }
type Number []Power
In the "reference" implementation (that one, dubbed gc
and available for download at https://golang.org):
The first argument to a method is the method's receiver.
In your case it's a pointer receiver, so 0xc042066150
is the address of that NumberEngine
instance in memory.
All the arguments are passed on the stack — from left to right.
struct
s appear in the order they are defined in the type.string
s and slices are compound types — of two and three fields each, respectively: pointer + length and pointer + length + capacity.For more info, we need the signature of the util.(*NumberEngine).Number
method, and the definitions of any custom types it uses, if any.