d4l3k/go-pry

Error running go-pry: panic: interface conversion: interface is nil, not reflect.Type

Gonzih opened this issue · 6 comments

Hi, I was trying to use this amazing project but stumbled upon the issue. Here is output that I'm getting:

panic: interface conversion: interface is nil, not reflect.Type                                                                                                                                                                                                                 

goroutine 1 [running]:
github.com/d4l3k/go-pry/pry.(*Scope).Interpret(0xc421ac8a20, 0x7feb32653268, 0xc42010e600, 0x7feb32653268, 0xc42010e600, 0x7d9540, 0xc420102620)
        /home/gnzh/go-projects/src/github.com/d4l3k/go-pry/pry/interpreter.go:350 +0x24a3
main.GetExports(0xc4202305f8, 0x6, 0xc420d04c00, 0xc4203174a0, 0xc4203174a0, 0x6c4084)
        /home/gnzh/go-projects/src/github.com/d4l3k/go-pry/main.go:338 +0x7ce
main.InjectPry(0xc4203242a0, 0x60, 0x6be3c3, 0x3, 0x300000001, 0xc4200001a0)
        /home/gnzh/go-projects/src/github.com/d4l3k/go-pry/main.go:77 +0x60c
main.main.func4(0xc420dfac80, 0x3c, 0x7dd1a0, 0xc420dfc0d0, 0x0, 0x0, 0x0, 0x0)
        /home/gnzh/go-projects/src/github.com/d4l3k/go-pry/main.go:251 +0xdd
path/filepath.walk(0xc420dfac80, 0x3c, 0x7dd1a0, 0xc420dfc0d0, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0xc420dfabc0, 0x34, 0x7dd1a0, 0xc420dfc000, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0xc42010e120, 0x2d, 0x7dd1a0, 0xc420df4340, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0xc420105ad0, 0x24, 0x7dd1a0, 0xc420259ee0, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0xc420cc0940, 0x17, 0x7dd1a0, 0xc420259e10, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0xc420254420, 0x11, 0x7dd1a0, 0xc4202525b0, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0xc420249388, 0x6, 0x7dd1a0, 0xc4202524e0, 0xc420080db0, 0x0, 0x0)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.walk(0x6be214, 0x1, 0x7dd1a0, 0xc420085860, 0xc420080db0, 0x0, 0x30)
        /usr/lib/go/src/path/filepath/path.go:376 +0x414
path/filepath.Walk(0x6be214, 0x1, 0xc420080db0, 0x0, 0x1)
        /usr/lib/go/src/path/filepath/path.go:398 +0x14c
main.main()
        /home/gnzh/go-projects/src/github.com/d4l3k/go-pry/main.go:259 +0x63d

I'm running go version go1.8.3 linux/amd64 on Arch Linux.

Here is the smallest project that I was able to reproduce the issue in:

https://github.com/Gonzih/go-pry-panic-issue-reproduction-example

Please feel free to ask for any extra information on my setup.

Thanks a lot!

I have the same issue

tmc commented

I see a similar failure -- it may be more appropriate to have a separate issue:

☯ ~/go/src/github.com/tmc/gotor(x/crypto)$ go-pry build
panic: interface conversion: interface is nil, not reflect.Type

goroutine 1 [running]:
main.GetExports(0xc420464658, 0x6, 0xc420e5ef30, 0xc4201c79b0, 0xc4201c79b0, 0x12c155a)
        /Users/tmc/go/src/github.com/d4l3k/go-pry/main.go:353 +0x5fc
main.InjectPry(0xc4201be840, 0x33, 0x12bba03, 0x3, 0x300000001, 0xc4200001a0)
        /Users/tmc/go/src/github.com/d4l3k/go-pry/main.go:77 +0x60c
main.main.func4(0xc4201be840, 0x33, 0x13db160, 0xc420f6e750, 0x0, 0x0, 0x0, 0x0)
        /Users/tmc/go/src/github.com/d4l3k/go-pry/main.go:251 +0xdd
path/filepath.walk(0xc4201be840, 0x33, 0x13db160, 0xc420f6e750, 0xc420011080, 0x0, 0x0)
        /usr/local/Cellar/go/1.8.3/libexec/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0xc420010244, 0x26, 0x13db160, 0xc420071110, 0xc420011080, 0x0, 0x30)
        /usr/local/Cellar/go/1.8.3/libexec/src/path/filepath/path.go:376 +0x414
path/filepath.Walk(0xc420010244, 0x26, 0xc420011080, 0x0, 0x12c2100)
        /usr/local/Cellar/go/1.8.3/libexec/src/path/filepath/path.go:398 +0x14c
main.main()
        /Users/tmc/go/src/github.com/d4l3k/go-pry/main.go:259 +0x63d
d4l3k commented

Sorry about that guys! I added some new features to the language last night and messed up the interface{} handling.