rogpeppe / godef

Print where symbols are defined in Go source code
BSD 3-Clause "New" or "Revised" License
666 stars 142 forks source link

internal error: nil Pkg importing "errors" from "mypkg" #118

Closed kevinburke1 closed 4 years ago

kevinburke1 commented 5 years ago

I can only reproduce this with a "package main" Go binary in the same directory as go.mod - if I have a main that's nested several directories under go.mod, I can't reproduce. I also can't reproduce in libraries.

Steps to reproduce:

Run

godef -f=$GOPATH/src/github.com/jmhodges/justrun/watch.go '-o=504' '-t'

I get the following error:

2019/10/22 09:35:08 internal error: nil Pkg importing "errors" from "github.com/jmhodges/justrun"
hyangah commented 4 years ago

Maybe dup of https://github.com/golang/go/issues/33554 which can be fixes with updating x/tools dependency.

hus787 commented 4 years ago

had to use the following to fix the problem

go get -v github.com/rogpeppe/godef@master

hyangah commented 4 years ago

v1.1.2 is released. Thanks @rogpeppe !