-
Notifications
You must be signed in to change notification settings - Fork 765
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
Go extension cannot recognize local go module. #529
Comments
@Aetherbase The go command treats them completely separate modules and tries to find A suggested workaround is to use the |
It looks like your module is not at the root of your workspace, and |
Thank you very much for the suggestions. |
@Aetherbase That's strange but without knowing actual directory layout and how you used redirect, I don't know what's going on. The pinned #275 issue describes the current gopls limitation. You can add to https://github.com/golang/vscode-go#language-server section. PR is welcome. |
What version of Go, VS Code & VS Code Go extension are you using?
Share the Go related settings you have added/edited
Describe the bug
Go extension cannot recognize go packages in go modules. Suggestions dont work either.Compiling and running the code works.
Expected auto suggestions support for go modules.
Steps to reproduce the behavior:
go mod init <go-mod-example>
<greet>
folder inside the module and create a function in go file<greet.go>
inside it, specifying<greet>
package<go-mod-example/greet>
package and call the function created in<greet.go>
could not import go-mod-example/greet (no package for import go-mod-example/greet)
Screenshots or recordings
Package code:
Main code with problem:
Main code with output of go run main.go:
The text was updated successfully, but these errors were encountered: