Skip to content

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

Description

@findleyr

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgegoplsIssues related to the Go language server, gopls.gopls/workspaceIssues related to support for modules or multi-module workspaces.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions