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/cmd/gopls: check command report function redeclared with another build tag #32458

Closed
wingyplus opened this issue Jun 6, 2019 · 2 comments
Closed

Comments

@wingyplus
Copy link
Contributor

@wingyplus wingyplus commented Jun 6, 2019

Please answer these questions before submitting your issue. Thanks!

What did you do?

In repository https://github.com/wingyplus/wire-tut. I have 2 InitializeEvent functions, one come from me write by my hand (di.go) and one generated from google/wire command.

When I ran gopls check ./di.go.

What did you expect to see?

No report anything because InitializeEvent in di.go has a wireinject build tag.

What did you see instead?

gopls report:

$ gopls check ./di.go
/Users/thanabodee/workspace/wire-tut/di.go:7:6-21: InitializeEvent redeclared in this block

Build info

golang.org/x/tools/cmd/gopls
    golang.org/x/tools@v0.0.0-20190606010934-2c3de6a5aea1 h1:X0hWR11/1QMjiO+1j6iB5GYJWYvBOl7/VAI3u0SXMno=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=

Go info

go version devel +16bf0d5e03 Thu May 2 23:12:11 2019 +0000 darwin/amd64

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/thanabodee/Library/Caches/go-build"
GOENV="/Users/thanabodee/Library/Preferences/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/thanabodee"
GOPROXY="direct"
GOROOT="/Users/thanabodee/tools/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/Users/thanabodee/tools/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/thanabodee/workspace/wire-tut/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/x7/tl6gyzn92vzcr35t94xgt6y00000gp/T/go-build053619932=/tmp/go-build -gno-record-gcc-switches -fno-common"
@gopherbot gopherbot added this to the Unreleased milestone Jun 6, 2019
@gopherbot gopherbot added the gopls label Jun 6, 2019
@ianthehat
Copy link

@ianthehat ianthehat commented Jun 6, 2019

This is because gopls does not very good at coping with build tags
we are tracking that in #29202 and although this is an interestingly different symptom I don't think it a different root cause.

@ianthehat ianthehat closed this Jun 6, 2019
@wingyplus
Copy link
Contributor Author

@wingyplus wingyplus commented Jun 6, 2019

I see. Thanks for your clarify.

@golang golang locked and limited conversation to collaborators Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.