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: `*invalid type` in test #38231

Closed
katiehockman opened this issue Apr 3, 2020 · 2 comments
Closed

x/tools/gopls: `*invalid type` in test #38231

katiehockman opened this issue Apr 3, 2020 · 2 comments

Comments

@katiehockman
Copy link
Member

@katiehockman katiehockman commented Apr 3, 2020

What did you do?

gopls doesn't seem to be able to recognize the *Certificate type of serialiseAndParse in this test: https://github.com/golang/go/blob/master/src/crypto/x509/x509_test.go#L1632. This applies to both the param and the return type.

You should be able to reproduce this by opening that file in VSCode and hovering over the function.
This also has the unfortunate side effect that auto-completion in other functions that use serialiseAndParse don't work, since the type is invalid.

What did you expect to see?

func serialiseAndParse(t *testing.T, template *Certificate) *Certificate

What did you see instead?

func serialiseAndParse(t *testing.T, template *invalid type) *invalid type

Build info

golang.org/x/tools/gopls v0.3.4
    golang.org/x/tools/gopls@v0.3.4 h1:4GC7q/pXQ/tsxHBGVdsMdlB4gCxVC06m/7rIXg1Px4E=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20200316194252-fafb6e2e8a4a h1:hKrQy/q8/Xivoqgw6nGiz1jqpn1WGBLDcWLZwW0983E=
    golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/tools@v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.14.1 darwin/amd64

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/katiehockman/Library/Caches/go-build"
GOENV="/Users/katiehockman/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/katiehockman/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="/dev/null"
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/f6/q4jm5l7j009_94_hjjmg8mt0009rg2/T/go-build049539152=/tmp/go-build -gno-record-gcc-switches -fno-common"

LMK if you need gopls logs and I can send them over.

@gopherbot gopherbot added this to the Unreleased milestone Apr 3, 2020
@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 3, 2020

Thanks for the report! I'm actually not able to reproduce this at master (which I don't think should be much different from v0.3.4, but it might be worth a shot to confirm). Can you share your gopls logs?

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 3, 2020

Discussed offline - resolved by opening go/src instead of go directory when working in the Go repository (because the go.mod is in go/src).

@stamblerre stamblerre closed this Apr 3, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.1 May 13, 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
3 participants
You can’t perform that action at this time.