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: Error loading workspace: You are outside of a module and outside of $GOPATH/src #45225

Closed
granzginz opened this issue Mar 25, 2021 · 7 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.

Comments

@granzginz
Copy link

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

$ go version
go version go1.16.2 windows/amd64

Does this issue reproduce with the latest release?

No

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

go env Output
$ go env

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Anjar\AppData\Local\go-build
set GOENV=C:\Users\Anjar\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Anjar\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Anjar\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.16.2
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\Camp Latihan Pemrograman\Heroku\go-getting-started\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Anjar\AppData\Local\Temp\go-build3937432002=/tmp/go-build -gno-record-gcc-switches

What did you do?

What did you expect to see?

No error and import file using go get depedency found folder to $goroot or $gopath

What did you see instead?

Error on importing file

@seankhliao seankhliao changed the title Error loading workspace: You are outside of a module and outside of $GOPATH/src x/tools/gopls: Error loading workspace: You are outside of a module and outside of $GOPATH/src Mar 25, 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 Mar 25, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 25, 2021
@stamblerre
Copy link
Contributor

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

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v1.0.0 Mar 30, 2021
@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 30, 2021
@granzginz
Copy link
Author

golang.org/x/tools/gopls v0.6.9
golang.org/x/tools/gopls@v0.6.9 h1:LBBcE2y3Tb4bp79JVLWCQBbvYCFEs5ADGWsQDoSLk1Q=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/mod@v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=
golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
golang.org/x/sys@v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk=
golang.org/x/tools@v0.1.1-0.20210319172145-bda8f5cee399 h1:O5bm8buX/OaamnfcBrkjn0SPUIU30jFmaS8lP+ikkxs=
golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
honnef.co/go/tools@v0.1.1 h1:EVDuO03OCZwpV2t/tLLxPmPiomagMoBOgfPt0FM+4IY=
mvdan.cc/gofumpt@v0.1.0 h1:hsVv+Y9UsZ/mFZTxJZuHVI6shSQCtzZ11h1JEFPAZLw=
mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

@stamblerre
Copy link
Contributor

Thanks for sharing that, but that's your gopls version output. I'm looking for the logs produced by gopls as it runs--https://github.com/golang/vscode-go/blob/master/docs/troubleshooting.md#collect-gopls-information describes how to gather these logs. Thanks!

@Bittu0184
Copy link

I am facing the same issue. Did you find the cause and solution?

@granzginz
Copy link
Author

I try to select a workplace and type code. on current folder.

@stamblerre stamblerre added this to To Do in gopls on-deck Apr 15, 2021
@stamblerre
Copy link
Contributor

@granzginz, @Bittu0184: Please provide your gopls logs so that we can help investigate the issue. Information on how to capture them can be found here.

gopls on-deck automation moved this from To Do to Done Apr 20, 2021
@stamblerre stamblerre reopened this Apr 20, 2021
gopls on-deck automation moved this from Done to To Do Apr 20, 2021
@stamblerre
Copy link
Contributor

Closing, as there hasn't been any activity on this issue for a few weeks.

gopls on-deck automation moved this from To Do to Done May 14, 2021
@stamblerre stamblerre removed this from the gopls/v1.0.0 milestone May 14, 2021
@golang golang locked and limited conversation to collaborators May 14, 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
No open projects
Development

No branches or pull requests

4 participants