from https://code.google.com/p/rog-go/source/browse/exp/cmd/godef/