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: issue importing standard package in vscode #44616

Closed
sickmon opened this issue Feb 25, 2021 · 4 comments
Closed

x/tools/gopls: issue importing standard package in vscode #44616

sickmon opened this issue Feb 25, 2021 · 4 comments

Comments

@sickmon
Copy link

@sickmon sickmon commented Feb 25, 2021

Hello,

While writing code in VSCode, if I use a new package, that same is getting added to import package list as expected. But the newly visible package in import gives below error and then automatic suggestion for the package used somewhere else will also not show anything. Only solution is to close vscode gui and open again. I have also enabled experimental features but no luck.
..
could not import fmt (no required module provides package "fmt")compiler
..

Please let me know if it is a bug or another issue. Also, if any other information is needed.
gopls

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Feb 25, 2021

Can you please share your gopls logs? Information on how to capture them can be found here.

@stamblerre stamblerre changed the title gopls having issue importing standard package in vscode x/tools/gopls: issue importing standard package in vscode Feb 25, 2021
@gopherbot gopherbot added this to the Unreleased milestone Feb 25, 2021
@sickmon
Copy link
Author

@sickmon sickmon commented Feb 26, 2021

Logs Attached. Please let me know if you need something else.
44616_logs.txt

@hyangah
Copy link
Contributor

@hyangah hyangah commented Feb 26, 2021

Thanks, but we wanted to have the gopls log described in the Collect gopls information section.

From what you've shared I see that you are currently working in GOPATH mode with multiple directories in GOPATH (/home/vagrant/golib:/home/vagrant/code).

Is the project directory under /home/vagrants/code/src and you opened the vscode from the /home/vagrants/code directory?
And, if possible I strongly recommend updating the go to 1.16.
1.15.1 is pretty outdated and lacks important security fixes.

@sickmon
Copy link
Author

@sickmon sickmon commented Feb 26, 2021

Hi ,

thanks for your suggestion. I updated go to 1.16 and its working as expected.

Thank you again.

@sickmon sickmon closed this Feb 26, 2021
@stamblerre stamblerre removed this from the gopls/v1.0.0 milestone Feb 27, 2021
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
4 participants