Skip to content

Commit 30741a5

Browse files
committed
Set GO111MODULE=on for go.work view
GO111MODULE=auto disables modules when go tool sees only go.work file. $ go version go version go1.23.1 linux/amd64 $ echo 'go 1.24' > go.work $ go version go version go1.24.0 linux/amd64 $ GO111MODULE=auto go version go version go1.23.1 linux/amd64 When go in $PATH is too old this breaks gopls for repositories like this: https://github.com/containers/container-libs/ Signed-off-by: Konstantin Khlebnikov <[email protected]>
1 parent d32ec34 commit 30741a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gopls/internal/cache/view.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ func (d viewDefinition) adjustedGO111MODULE() string {
243243
if d.folder.Env.GO111MODULE != "" {
244244
return d.folder.Env.GO111MODULE
245245
}
246+
if d.typ == GoWorkView {
247+
return "on"
248+
}
246249
return "auto"
247250
}
248251

0 commit comments

Comments
 (0)