Skip to content

x/tools/gopls: mod tidiness is a precondition for diagnostics #56395

Open
@adonovan

Description

@adonovan

If you build gopls at today's head and check out a new github.com/kubernetes/kubernetes repo, then run the 'check' subcommand, it fails because of the go.mod tidiness check:

kubernetes$ gopls check ./cmd/kubectl/kubectl.go 
2022/10/24 11:19:00 Error:2022/10/24 11:19:00 tidy: diagnosing file:///Users/adonovan/w/kubernetes/go.mod: err: exit status 1: stderr: go: bitbucket.org/bertimus9/[email protected]: module lookup disabled by GOPROXY=off
go: downloading github.com/onsi/ginkgo v1.14.0
...many more...
go: downloading golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717
go: k8s.io/[email protected] requires
	github.com/go-openapi/[email protected]: module lookup disabled by GOPROXY=off

2022/10/24 11:19:00 Error:2022/10/24 11:19:00 tidy: diagnosing file:///Users/adonovan/w/kubernetes/go.mod: err: exit status 1: stderr: go: bitbucket.org/bertimus9/[email protected]: module lookup disabled by GOPROXY=off
go: downloading github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
...
go: k8s.io/[email protected] requires
	github.com/go-openapi/[email protected]: module lookup disabled by GOPROXY=off

This remains true even after a successful go build ./cmd/kubectl/ to download modules. Running go mod tidy fixes the problem.

gopls should not make mod tidiness a precondition for analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/metadataIssues related to metadata loading in gopls

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions