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: upgrade check doesn't work with vendor directory #44756

Open
hummerd opened this issue Mar 3, 2021 · 0 comments
Open

x/tools/gopls: upgrade check doesn't work with vendor directory #44756

hummerd opened this issue Mar 3, 2021 · 0 comments
Labels
Milestone

Comments

@hummerd
Copy link

@hummerd hummerd commented Mar 3, 2021

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

golang.org/x/tools/gopls v0.6.6
    golang.org/x/tools/gopls@v0.6.6 h1:GmCsAKZMEb1BD1BTWnQrMyx4FmNThlEsmuFiJbLBXio=

go version go1.16 linux/amd64

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

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dima/.cache/go-build"
GOENV="/home/dima/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/dima/dvl/go/pkg/mod"
GONOPROXY="..."
GONOSUMDB=".."
GOOS="linux"
GOPATH="/home/dima/dvl/go"
GOPRIVATE="..."
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1594619228=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Clicked "Check for upgrade" lens in go.mod file

What did you expect to see?

Available upgrades

What did you see instead?

Error message Running the contributed command: '_vscode_delegate_cmd_klt93z4u' failed.

gopls server logs

[Error - 2:12:12 PM] Request workspace/executeCommand failed.
  Message: err: exit status 1: stderr: go list -m: can't determine available upgrades using the vendor directory
	(Use -mod=mod or -mod=readonly to bypass.)

  Code: 0 
[Error - 2:12:12 PM] 2021/03/03 14:12:12 command error: err: exit status 1: stderr: go list -m: can't determine available upgrades using the vendor directory
	(Use -mod=mod or -mod=readonly to bypass.)

Here is my VSCode settings for gopls

    "gopls": {
        // Add parameter placeholders when completing a function.
        "usePlaceholders": true,

        // If true, enable additional analyses with staticcheck.
        // Warning: This will significantly increase memory usage.
        // "staticcheck": true,
        "codelenses": {
            "generate": false,  // Don't run `go generate`.
            "gc_details": true  // Show a code lens toggling the display of gc's choices.
        },
    },

Shouldn't gopls run go list -m with -mod=readonly flag?

@gopherbot gopherbot added this to the Unreleased milestone Mar 3, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.6.7 Mar 3, 2021
@stamblerre stamblerre changed the title x/tools/gopls: Check for upgrades does not work in go.mod x/tools/gopls: upgrade check doesn't work with vendor directory Mar 3, 2021
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