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: getting BrokenImport Error #49715

Closed
n9hal opened this issue Nov 22, 2021 · 8 comments
Closed

x/tools/gopls: getting BrokenImport Error #49715

n9hal opened this issue Nov 22, 2021 · 8 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@n9hal
Copy link

n9hal commented Nov 22, 2021

What version of Go are you using (go version)?

1.17.2

$ go version



Does this issue reproduce with the latest release?

NA

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
![image](https://user-images.githubusercontent.com/57591622/142818761-a173c96d-1c26-454c-82cb-c27743abef80.png)

What did you do?

trying to import the gorm package.

What did you expect to see?

to see proper output

What did you see instead?

image

image

@seankhliao
Copy link
Member

Do you have a go.mod file in you project and did you open your editor there?

@n9hal
Copy link
Author

n9hal commented Nov 22, 2021

yes. I tried without go.mod file also but same error

@seankhliao
Copy link
Member

which directory/folder did you open vscode in?

@n9hal
Copy link
Author

n9hal commented Nov 22, 2021

my go_workspace (Location: D:\Codes\go_workspace )

  • vscode Screenshot

image

  • env path
    image

@n9hal
Copy link
Author

n9hal commented Nov 22, 2021

and other thing when I used go mod init command to create the go.mod file, it shows the error like this

image

@seankhliao seankhliao changed the title getting BrokenImport Error x/tools/gopls: getting BrokenImport Error Nov 22, 2021
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 22, 2021
@gopherbot gopherbot added this to the Unreleased milestone Nov 22, 2021
@hyangah
Copy link
Contributor

hyangah commented Nov 22, 2021

Given that go env GOMOD output NULL, I guess your go.mod file is not in the workspace root.
The module root directory should be in the workspace root (D:\Codes\go_workspace) or you need to configure to work with multiple modules. Please see https://github.com/golang/vscode-go#setting-up-your-workspace - in particular, the last paragraph.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 22, 2021
@n9hal
Copy link
Author

n9hal commented Nov 24, 2021

Okay I'll try

@n9hal
Copy link
Author

n9hal commented Nov 25, 2021

Thank you guys, Its working now...

@n9hal n9hal closed this as completed Nov 25, 2021
@golang golang locked and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants