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: errors.As warning for no apparent reason #41903

Closed
pofl opened this issue Oct 10, 2020 · 3 comments
Closed

x/tools/gopls: errors.As warning for no apparent reason #41903

pofl opened this issue Oct 10, 2020 · 3 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

@pofl
Copy link

pofl commented Oct 10, 2020

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

$ go version
go version go1.15.2 linux/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=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pofl/.cache/go-build"
GOENV="/home/pofl/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/pofl/Documents/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pofl/Documents/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/linuxbrew/.linuxbrew/Cellar/go/1.15.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/linuxbrew/.linuxbrew/Cellar/go/1.15.2/libexec/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc-5"
CXX="g++-5"
CGO_ENABLED="1"
GOMOD="/home/pofl/dwh-kafka2pubsub/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build040311524=/tmp/go-build -gno-record-gcc-switches"

What did you do?

image

What did you expect to see?

no complaints

What did you see instead?

warning "second argument to errors.As must be a non-nil pointer to either a type that implements error, or to any interface type"

@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 Oct 10, 2020
@gopherbot gopherbot added this to the Unreleased milestone Oct 10, 2020
@stamblerre
Copy link
Contributor

stamblerre commented Oct 10, 2020

I believe what you want here is errors.As(err, &e), since *connErr implements error, and the second argument must be a pointer to a type that implements error.

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 10, 2020
@stamblerre
Copy link
Contributor

Mistyped in the earlier response--I meant errors.As(err, &e).

@pofl
Copy link
Author

pofl commented Oct 11, 2020

You're right. Damn, go is so quirky sometimes. Thank you for answering.

@pofl pofl closed this as completed Oct 11, 2020
@pofl pofl reopened this Oct 11, 2020
@pofl pofl closed this as completed Oct 11, 2020
@golang golang locked and limited conversation to collaborators Oct 11, 2021
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

3 participants