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

Printing the receiver for methods when printing types #93

Open
segevfiner opened this issue Nov 10, 2018 · 0 comments
Open

Printing the receiver for methods when printing types #93

segevfiner opened this issue Nov 10, 2018 · 0 comments

Comments

@segevfiner
Copy link

segevfiner commented Nov 10, 2018

Methods in Go have a receiver, and you can have multiple methods with the same name but a different receiver. In order to make it easier for users of godef to figure out the exact function the definition refers to, it would be useful if godef supplies some way to print the methods receiver along with it's type.

For example for:

package main

import (
	"bufio"
	"os"
)

func main() {
	bufio.NewScanner(os.Stdin)
}

Running godef.exe -t -f foo.go bufio.Reader.ReadLine, gives you:

C:\Go\src\bufio\bufio.go:369:18
ReadLine func() (line []byte, isPrefix bool, err error)

While ReadLine has a b *Reader receiver which is unavailable in the current output.

This will make it easier to resolve microsoft/vscode-go#2107.

cc @ramya-rao-a

segevfiner added a commit to segevfiner/godef that referenced this issue Dec 26, 2018
segevfiner added a commit to segevfiner/godef that referenced this issue Dec 26, 2018
segevfiner added a commit to segevfiner/godef that referenced this issue Dec 26, 2018
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

1 participant