Skip to content

x/tools/gopls: adding gopls as a tool dependency leads to build failures #73279

Open
@corani

Description

@corani

gopls version

	golang.org/x/tools v0.32.0 // indirect
	golang.org/x/tools/gopls v0.18.1 // indirect

go env

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='snip/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='snip/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2682111243=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='snip/go.mod'
GOMODCACHE='snip/go/pkg/mod'
GONOPROXY='snip'
GONOSUMDB='*'
GOOS='linux'
GOPATH='snip/go'
GOPRIVATE='snip'
GOPROXY='snip'
GOROOT='snip/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='snip/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='snip/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.24.2.linux-amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

go tool modernize --fix ./...

What did you see happen?

# golang.org/x/tools/gopls/internal/analysis/modernize
vendor/golang.org/x/tools/gopls/internal/analysis/modernize/bloop.go:167:29: c.Ancestors undefined (type cursor.Cursor has no field or method Ancestors)
vendor/golang.org/x/tools/gopls/internal/analysis/modernize/rangeint.go:156:15: cur.Edge undefined (type cursor.Cursor has no field or method Edge)
vendor/golang.org/x/tools/gopls/internal/analysis/modernize/rangeint.go:159:15: cur.Edge undefined (type cursor.Cursor has no field or method Edge)
vendor/golang.org/x/tools/gopls/internal/analysis/modernize/splitseq.go:55:30: curRange.Edge undefined (type cursor.Cursor has no field or method Edge)
vendor/golang.org/x/tools/gopls/internal/analysis/modernize/testingcontext.go:113:26: curFunc.Edge undefined (type cursor.Cursor has no field or method Edge)

What did you expect to see?

no errors :)

Editor and settings

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions