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: mod tidiness is a precondition for diagnostics #56395

Open
adonovan opened this issue Oct 24, 2022 · 0 comments
Open

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

adonovan opened this issue Oct 24, 2022 · 0 comments
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

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/systemstat@v0.0.0-20180207000608-0eeff89b0690: 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/code-generator@v0.0.0 requires
	github.com/go-openapi/jsonreference@v0.19.5: 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/systemstat@v0.0.0-20180207000608-0eeff89b0690: module lookup disabled by GOPROXY=off
go: downloading github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
...
go: k8s.io/code-generator@v0.0.0 requires
	github.com/go-openapi/jsonreference@v0.19.5: 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.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 24, 2022
@gopherbot gopherbot added this to the Unreleased milestone Oct 24, 2022
@adonovan adonovan modified the milestones: Unreleased, gopls/v0.10.1 Oct 24, 2022
@findleyr findleyr modified the milestones: gopls/v0.10.1, gopls/v0.10.2 Nov 1, 2022
@findleyr findleyr modified the milestones: gopls/v0.10.2, gopls/v0.11.0 Nov 10, 2022
@findleyr findleyr modified the milestones: gopls/v0.12.0, gopls/v0.13.0 Mar 27, 2023
@findleyr findleyr modified the milestones: gopls/v0.14.0, gopls/v0.15.0 Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants