Skip to content

Gopls breaks go mod tidy though an incorrect patch version dependency on golang.org/x/tools #64994

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

Closed
Zemnmez opened this issue Jan 7, 2024 · 0 comments

Comments

@Zemnmez
Copy link

Zemnmez commented Jan 7, 2024

Go version

go version go1.20.7 linux/amd64

Output of go env in your module/workspace:

thomas@DESKTOP-B82ERE8 ~/.c/b/_/a/e/o/i/l/source> go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/thomas/.cache/go-build"
GOENV="/home/thomas/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/thomas/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/thomas/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/thomas/.cache/bazel/_bazel_thomas/a41610ee02ad9c69b13020a7f1cf3deb/external/go_sdk"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/thomas/.cache/bazel/_bazel_thomas/a41610ee02ad9c69b13020a7f1cf3deb/external/go_sdk/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.7"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="/home/linuxbrew/.linuxbrew/bin/gcc-12"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/thomas/.cache/bazel/_bazel_thomas/a41610ee02ad9c69b13020a7f1cf3deb/external/org_golang_x_tools_gopls/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1786368587=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Make the following go file:

//go:build tools
// +build tools

package tools //import "example.com/fake"

import (
	_ "golang.org/x/tools/cmd/goimports"
	_ "golang.org/x/tools/gopls"
)

go mod init; go mod tidy

What did you see happen?

go: creating new go.mod: module example.com/fake
go: to add module requirements and sums:
        go mod tidy
go: finding module for package golang.org/x/tools/gopls
go: finding module for package golang.org/x/tools/cmd/goimports
go: found golang.org/x/tools/cmd/goimports in golang.org/x/tools v0.16.1
go: found golang.org/x/tools/gopls in golang.org/x/tools/gopls v0.14.2
go: finding module for package golang.org/x/tools/internal/persistent
example.com/fake imports
        golang.org/x/tools/gopls imports
        golang.org/x/tools/gopls/internal/lsp/cmd imports
        golang.org/x/tools/gopls/internal/lsp/cache imports
        golang.org/x/tools/internal/persistent: module golang.org/x/tools@latest found (v0.16.1), but does not contain package golang.org/x/tools/internal/persistent

What did you expect to see?

No errors.

@Zemnmez Zemnmez closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2024
@golang golang locked and limited conversation to collaborators Jan 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants