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 by expression not working with go/packages #104

Open
segevfiner opened this issue Dec 25, 2018 · 3 comments
Open

godef by expression not working with go/packages #104

segevfiner opened this issue Dec 25, 2018 · 3 comments

Comments

@segevfiner
Copy link

segevfiner commented Dec 25, 2018

I think this works without go/packages:

  1. Create hello.go:
package main

import "fmt"

func main() {
	fmt.Println("Hello, World!")
}
  1. go mod init.
  2. Run godef -f hello.go fmt.Println.
  3. You get the error: godef: Offset -1 was not a valid identifier
@segevfiner segevfiner changed the title godef by expression no longer working godef by expression not working with go/packages Dec 25, 2018
@sunliver
Copy link

try godef -t -f hello.go -o 43, you may get

xxx/hello.go:3:8
import (fmt "fmt")

@segevfiner
Copy link
Author

try godef -t -f hello.go -o 43, you may get

xxx/hello.go:3:8
import (fmt "fmt")

This is about the expression mode not working. Offset mode still works.

@sunliver
Copy link

sunliver commented Dec 27, 2018

Mod is not supporting expression now, it uses https://godoc.org/golang.org/x/tools/go/packages to find definition.

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