-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: excessive packages.Load calls with an ad-hoc package outside of GOPATH/module #42813
Comments
Can you please share a |
Here's the log: |
It looks like you delete and then replace the full content of the file in this log. My guess is that this is a bug that is actually fixed in Go 1.16. If you're willing to try building Go 1.16 from source, you can confirm that way (https://golang.org/doc/install/source). Another way to test this out would be to add something like |
Adding |
Thanks for the update. It's still a little tricky to see exactly what's going on here, so I will now have to ask you to try reproducing with Go 1.16. Since it's not yet released, you will have to follow the steps for building Go from source here: https://golang.org/doc/install/source. If the issue persists with Go 1.16, then there is probably a |
One thing to note is that you may be able to resolve the problem by creating a module ( |
Seems to be fixed in 1.16. Unable to reproduce on |
Change https://golang.org/cl/274443 mentions this issue: |
Change https://golang.org/cl/275436 mentions this issue: |
Previously, we would always reload views with invalid build configurations on every call to reloadWorkspace, even if the metadata had no reason to be treated as invalid. Fixes golang/go#42813 Change-Id: I9e0e493228916262908b81bc1b1ab1eb4e4eca9e Reviewed-on: https://go-review.googlesource.com/c/tools/+/274443 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> (cherry picked from commit 2ecf2a5) Reviewed-on: https://go-review.googlesource.com/c/tools/+/275436 Run-TryBot: Robert Findley <rfindley@google.com>
Previously, we would always reload views with invalid build configurations on every call to reloadWorkspace, even if the metadata had no reason to be treated as invalid. Fixes golang/go#42813 Change-Id: I9e0e493228916262908b81bc1b1ab1eb4e4eca9e Reviewed-on: https://go-review.googlesource.com/c/tools/+/274443 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogopls -v version
to get version of Gopls if you are using the language server.golang.org/x/tools/gopls@v0.5.3 h1:C8QSrqjqaVzlVoHL1R9yWbROoOApRgI8gN1G+cHlPuw=
github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/google/go-cmp@v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/mod@v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/sync@v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
golang.org/x/tools@v0.0.0-20201110032815-ae45d7cf37a9 h1:S0ATUNSw92bO7f5Z+1tSQsq48TdQs2Ye2rTGJdtf5qc=
golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
honnef.co/go/tools@v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
mvdan.cc/gofumpt@v0.0.0-20200927160801-5bfeb2e70dd6 h1:z+/YqapuV7VZPvBb3GYmuEJbA88M3PFUxaHilHYVCpQ=
mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insidersgo env
to get the go development environment detailsGOARCH="amd64"
GOBIN=""
GOCACHE="/Users/df/Library/Caches/go-build"
GOENV="/Users/df/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/df/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/df/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gd/ck6ncspn19115_7mxytyzw840000gp/T/go-build473384269=/tmp/go-build -gno-record-gcc-switches -fno-common"
Share the Go related settings you have added/edited
"go.useLanguageServer": true,
Describe the bug
When I save a file, it automatically adds any used package to import section. When that happens, I get a phantom error:
I still compiles, and if I comment/uncomment the import, the error goes away, but it's still very annoying.
Steps to reproduce the behavior:
Screenshots or recordings
The text was updated successfully, but these errors were encountered: