-
Notifications
You must be signed in to change notification settings - Fork 89
Accept import paths like golang_org/x/* #357
Conversation
return nil, err | ||
} | ||
d.ProjectRoot = strings.Replace(d.ProjectRoot, "github.com/golang/", "golang_org/x/", 1) | ||
return d, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to the previous case, except the .
has been replaced with _
in golang.org/x/
These dependencies are actually coming from the Go stdlib. In older Go versions (not master, but all currently published Go versions), it uses an old form of vendoring where they basically just copy the golang.org/x/ packages into $GOROOT/src under a https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/golang/go%24%40go1.11+golang_org Since this is a form of vendoring, it means that your approach here could link someone to the latest version of an golang.org/x/ package while the one in use is actually that version around the time of the Go language server's release. However, given we do not support multiple Go versions, we do not publish which Go version our langserver is using clearly anywhere, and the fact that these dependencies are very rare in practice (and are going away in Go 1.12), and 99% of users are unlikely to encounter them -- this LGTM as a method of suppressing the log noise. Could you add some docs to the switch case to indicate the above? |
Thanks for the additional note 👍 I summarized that in a little doc on each |
Thanks, fixed in 6d238ad |
Previously, go-langserver would log errors saying it could not find some
golang_org/x/*
packages:This did not affect the language server as far as I can tell - it only caused some distracting error messages.
See golang/go#17326