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: no metadata for package #41209

Open
matthewmueller opened this issue Sep 3, 2020 · 4 comments
Open

x/tools/gopls: no metadata for package #41209

matthewmueller opened this issue Sep 3, 2020 · 4 comments

Comments

@matthewmueller
Copy link

@matthewmueller matthewmueller commented Sep 3, 2020

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

$ go version
go version go1.15 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/m/Library/Caches/go-build"
GOENV="/Users/m/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/m/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB="github.com/matthewmueller"
GOOS="darwin"
GOPATH="/Users/m/Go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/m/Go/src/github.com/matthewmueller/duo-blank/go.mod"
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/4f/tcxcr6_55v9bp38d8g4hjlf80000gn/T/go-build780462967=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I'm working on some code generators right now, so I'm very often deleting the entire module and re-generating. Sometimes I tweak the generated code before re-generating. I'm using rm -rf ./duo-blank from the CLI to delete the project.

In this case, I added an articles_test.go, then ran rm -rf ./duo-blank, then re-generated. The re-generated code does not include a replacement articles_test.go.

It appears there's some cached metadata hasn't been cleared out.

What did you expect to see?

I expect to see this message The code in the workspace failed to compile less often.

What did you see instead?

It shows up every time I save, so it's a bit annoying.

CleanShot 2020-09-03 at 21 56 38@2x

The code in the workspace failed to compile (see the error message below). 
If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new. 

no metadata for github.com/matthewmueller/duo-blank/controllers/articles_test 
[github.com/matthewmueller/duo-blank/controllers/articles.test]
@gopherbot gopherbot added the gopls label Sep 3, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 3, 2020

Is this with gopls/v0.4.4 (gopls version)? If so, I believe this has been fixed at master. You can try it out by downloading gopls at master: GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master.

@stamblerre stamblerre changed the title gopls: No metadata for package x/tools/gopls: no metadata for package Sep 3, 2020
@gopherbot gopherbot added the Tools label Sep 3, 2020
@gopherbot gopherbot added this to the Unreleased milestone Sep 3, 2020
@stapelberg
Copy link
Contributor

@stapelberg stapelberg commented Sep 5, 2020

Can confirm: I ran into this message after deleting the only _test.go file of a package with gopls/v0.4.4.

After upgrading to master, I can no longer reproduce the issue, i.e. everything seems to work fine.

@matthewmueller
Copy link
Author

@matthewmueller matthewmueller commented Sep 6, 2020

Sure, I'll give it another go. I'm currently on master for another reason (I forget why), but maybe the SHA can help.

golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.0.0-20200825202427-b303f430e36d h1:QyA0HwYgL5o8rGsDjB0IV8rfGHD0lYFlot/cqL6+LTY=
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Sep 6, 2020

I'm not actually sure when the bug was fixed, so I'd recommend updating to the current master.

@stamblerre stamblerre removed this from the Unreleased milestone Sep 11, 2020
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
You can’t perform that action at this time.