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

x/tools/cmd/guru: no way to find functions which are assignable to (match the signature of) a function type #25165

a-h opened this issue Apr 29, 2018 · 3 comments · May be fixed by golang/tools#37


Copy link

@a-h a-h commented Apr 29, 2018

If I define a function type:

type Printer func(s string)

And a function which accepts a Printer:

type Print(s string, p Printer) {

I'd like to be able to use guru to find methods which satisfy the Printer type's signature. I'd also be able to find any matching functions for an anonymous function signature too (e.g. var x func(s string)).

guru is often used to provide text editor features. Having the ability to discover implementations would allow being able to place a caret on p Printer, select Find implementations from the text editor options, then view a list of possible implementations to use.

I've put together an example of how this might work at

(See Stackoverflow question at

@gopherbot gopherbot added this to the Unreleased milestone Apr 29, 2018
Copy link

@bcmills bcmills commented Apr 30, 2018

Copy link

@stamblerre stamblerre commented May 2, 2018

This would be a nice feature and could probably become part of the existing "implements" query. If you'd like to contribute the code you wrote, feel free to send out a review. Otherwise, I'd be happy to look into adding this.

Copy link
Contributor Author

@a-h a-h commented Jun 22, 2018

Does anyone have any interest in reviewing this on Gerrit?

@gopherbot gopherbot added the Tools label Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.