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

cmd/go, gopls: go.work file not detected in GOROOT #59429

Closed
findleyr opened this issue Apr 4, 2023 · 3 comments
Closed

cmd/go, gopls: go.work file not detected in GOROOT #59429

findleyr opened this issue Apr 4, 2023 · 3 comments
Labels
FrozenDueToAge gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Apr 4, 2023

I noticed that when my go.work file is in GOROOT, gopls@master no longer loads both std and cmd. This is because we've started using go env GOWORK to find go.work files, and this does not behave as expected when the go.work file is in GOROOT.

Tested with go version devel go1.21-f62c9701b4 Tue Apr 4 07:17:19 2023 +0000 linux/amd64

Simple repro:

$ cd $(go env GOWORK)
$ go work init src src/cmd
$ go env GOWORK
/path/to/GOROOT/go.work
$ cd src
$ go env GOWORK
<nothing>

CC @bcmills @matloob

@findleyr findleyr added the gopls/workspace Issues related to support for modules or multi-module workspaces. label Apr 4, 2023
@findleyr findleyr added this to the gopls/v0.12.0 milestone Apr 4, 2023
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Apr 4, 2023
@gopherbot
Copy link

Change https://go.dev/cl/482016 mentions this issue: gopls/doc: add instructions for using go.work with the Go distribution

gopherbot pushed a commit to golang/tools that referenced this issue Apr 4, 2023
Following the discovery of golang/go#59429, we should have more detailed
instructions for how to use a `go.work` file with the Go distribution.

Change-Id: I9aab204832cfc08016f4f3c53cbe7195e23cf21c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/482016
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
@bcmills
Copy link
Contributor

bcmills commented Apr 5, 2023

Duplicate of #52084? (CC @hyangah @matloob)

@findleyr
Copy link
Contributor Author

findleyr commented Apr 5, 2023

Yes, looks like a dupe. Thanks.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
@golang golang locked and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls/workspace Issues related to support for modules or multi-module workspaces. gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

3 participants