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/gopls: failures when switching from GOPATH to modules #37069

Closed
stamblerre opened this issue Feb 5, 2020 · 3 comments
Closed

x/tools/gopls: failures when switching from GOPATH to modules #37069

stamblerre opened this issue Feb 5, 2020 · 3 comments

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 5, 2020

Reported by @tbpg (please correct me if I'm mistaken here).

Repro steps:

  1. Open a package that was previously set up to work in GOPATH mode.
  2. Initialize a module.
  3. There is a missing dependency - add it to the go.mod.
  4. Errors about the missing dependency do not go away.
@gopherbot gopherbot added this to the Unreleased milestone Feb 5, 2020
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Feb 5, 2020
@tbpg
Copy link
Contributor

@tbpg tbpg commented Feb 6, 2020

The missing dependency was a package within the project.

Kind of like this:

.
├── bar
│   └── bar.go
└── foo.go # imported myproject/bar

When I opened foo.go, there was an error about not being able to find myproject/bar. So, I did go mod init example.com/myproject then changed the import to example.com/myproject/bar.

Then I still got the error that myproject/bar was not found (not an error about example.com/myproject/bar)

@stamblerre
Copy link
Contributor Author

@stamblerre stamblerre commented Jul 30, 2020

I am not able to reproduce this when running through the repro steps myself in gopls, but I am able to reproduce this in a regression test, which leads me to believe that this is an issue caused by #40340. Going to close this as a duplicate, but put up a CL with this repro case as a regression test.

@stamblerre stamblerre closed this Jul 30, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 30, 2020

Change https://golang.org/cl/245818 mentions this issue: internal/lsp: add a test for golang/go#37069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.