zmb3 / godoc

Deprecated - use https://atom.io/packages/go-plus instead
MIT License
4 stars 1 forks source link

Strange gogetdoc error && ui #33

Open averrin opened 8 years ago

averrin commented 8 years ago

Set cursor to log.Println toggle godoc

gideon1

Atom: 1.10-beta6 Theme: Accents Syntax: Base16 Tomorrow Dark

❯ type gogetdoc
gogetdoc is /home/user/projects/go/bin/gogetdoc
❯ type godoc
godoc is /usr/local/go/bin/godoc
averrin commented 8 years ago

if it helps

❯ gogetdoc -pos $GOROOT/src/fmt/format.go:#6274
gogetdoc: no documentation found
❯ la $GOROOT/src/fmt/format.go
-rw-r--r-- 1 root root 12K авг 16 01:47 /usr/local/go/src/fmt/format.go
❯ go version
go version go1.7 linux/amd6
zmb3 commented 8 years ago

What version of the godoc plugin are you running? Is your GOPATH set correctly?

averrin commented 8 years ago

godoc version: 0.3.1

❯ echo $GOPATH
/home/user/projects/go

other go-plus tools works nice

zmb3 commented 8 years ago

If GOPATH is /home/user/projects/go, then your source code should be at /home/user/projects/go/src.

In the screenshot above, it looks like your code is at /home/user/projects/shodan, which is outside your GOPATH.

The 6274 offset in format.go was a good example for Go 1.6, but the Go 1.7 source has changed. Try this from the command line:

❯  gogetdoc -pos "$GOROOT/src/fmt/format.go:#2352"
import "unicode/utf8"

func RuneCountInString(s string) (n int)
RuneCountInString is like RuneCount but its input is a string.
averrin commented 8 years ago

I have symlink from /home/user/projects/shodan to /home/user/projects/go/src/github.com/averrin/shodan

So, with this offset gogetdoc works:

gogetdoc -pos "$GOROOT/src/fmt/format.go:#2352" 
import "unicode/utf8"

func RuneCountInString(s string) (n int)

RuneCountInString is like RuneCount but its input is a string.
zmb3 commented 8 years ago

So the symlink is the issue. We don't currently support symlinks, but I will look into what we need to do to make this happen as you aren't the first to run into this.