Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godef support #14

Closed
tobstarr opened this issue Feb 9, 2015 · 1 comment
Closed

Godef support #14

tobstarr opened this issue Feb 9, 2015 · 1 comment

Comments

@tobstarr
Copy link

tobstarr commented Feb 9, 2015

There seems to be an issue in combination with godef (http://godoc.org/code.google.com/p/rog-go/exp/cmd/godef), probably due to some build flags?

~/src/github.com/bugsnag/bugsnag-go $ godef -t -debug -f ./doc.go bugsnag.Configure
2015/02/09 11:18:18 exprType tuple:false pkg: *ast.SelectorExpr bugsnag.Configure [
2015/02/09 11:18:18 exprType tuple:false pkg: *ast.Ident bugsnag [
2015/02/09 11:18:18 ] -> 0x0, Type{bad "" }
2015/02/09 11:18:18 ] -> 0x0, Type{bad "" }
godef: no declaration found for bugsnag.Configure

Any ideas?

@rogpeppe
Copy link

rogpeppe commented Feb 9, 2015

Your command line is wrong. It should be

godef -t -debug -f ./doc.go Configure

because "bugsnag" isn't a defined identifier in the bugsnag
package itself.

However, even with that, it still doesn't work, which is
due to a bug in godef. The issue is that when you pass
an expression on the command line, it's interpreted
in the context of the file that you've specified, but at that
point we have only read that one file and not the whole
package, so the identifier was not resolved then - we
need to reparse the expression.

This works fine, for example:

godef -t -debug -f ./doc.go Configure

Please raise an issue at http://github.com/rogpeppe/godef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants