You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.6
What operating system and processor architecture are you using (go env)?
darwin
What did you do?
go get github.com/tschottdorf/goplay && oracle \
-pos=$GOPATH/src/github.com/tschottdorf/goplay/oracle_test_boom/main.go:#40 \
callers github.com/tschottdorf/goplay/oracle_test_boom/
What did you expect to see?
The list of callers of (*X).Bar() (i.e., an empty list).
What did you see instead?
/Users/tschottdorf/go/src/github.com/tschottdorf/goplay/oracle_test_boom/main_test.go:10:2: invalid operation: (&(main.X literal)) (value of type *github.com/tschottdorf/goplay/oracle_test_boom.X) has no field or method Foo
oracle: couldn't load packages due to errors: github.com/tschottdorf/goplay/oracle_test_boom/_test
In fact, this completely renders oracle unusable in source trees which have this phenomenon.
I notice that the trailing slash in the -scope argument seems to confuse the tool:
$ guru -scope github.com/tschottdorf/goplay/oracle_test_boom/ callers $GOPATH/src/github.com/tschottdorf/goplay/oracle_test_boom/main.go:#40
/usr/local/google/home/adonovan/got3/src/github.com/tschottdorf/goplay/oracle_test_boom/main_test.go:10:2: invalid operation: (&(main.X literal)) (value of type *github.com/tschottdorf/goplay/oracle_test_boom.X) has no field or method Foo
guru: couldn't load packages due to errors: github.com/tschottdorf/goplay/oracle_test_boom/_test
Removing the slash seems to be an effective workaround:
$ guru -scope github.com/tschottdorf/goplay/oracle_test_boom callers $GOPATH/src/github.com/tschottdorf/goplay/oracle_test_boom/main.go:#40
/usr/local/google/home/adonovan/got3/src/github.com/tschottdorf/goplay/oracle_test_boom/main.go:5:10: (github.com/tschottdorf/goplay/oracle_test_boom.X).Bar is called from these 0 sites:
alandonovan
changed the title
x/tools/cmd/oracle: fails when test defines method on non-test receiver
x/tools/cmd/guru: confusing error message when scope has trailing slash
Mar 4, 2016
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6
go env
)?darwin
The list of callers of
(*X).Bar()
(i.e., an empty list).In fact, this completely renders oracle unusable in source trees which have this phenomenon.
(cc: @mrtracy)
The text was updated successfully, but these errors were encountered: