]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: improve error message for failing to read module listed...
authorZeke Lu <lvzecai@gmail.com>
Fri, 7 Oct 2022 00:49:15 +0000 (00:49 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 8 Oct 2022 09:29:15 +0000 (09:29 +0000)
commit28a05f541dd218c40cc221db4e97898cc5a3b902
tree4ca4dc48122adebede0969f8e12b968295b8d109
parent4fe1971b2dff1fa14cb8f5be47aed7fda76c0f7c
cmd/go/internal/modload: improve error message for failing to read module listed in go.work

Run "go build ./x" in this workspace:

  -- go.work --
  use ./y
  -- x/go.mod --
  module x

  go 1.19
  -- x/m.go --
  package m

It fails with: "go: open /tmp/foo/y/go.mod: no such file or directory".
It's unclear where the name "y" comes from.
This change will emit error like: "go: cannot load module listed in
go.work file: open /tmp/foo/y/go.mod: no such file or directory"

Fixes #55952.

Change-Id: Ia45dd915e3fbd6e33340f352b3d6235c6c31190b
GitHub-Last-Rev: 410de1b4a71d07bbd5abd1482b6d55fa29f31336
GitHub-Pull-Request: golang/go#56050
Reviewed-on: https://go-review.googlesource.com/c/go/+/438147
Run-TryBot: hopehook <hopehook@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/work_use_issue55952.txt [new file with mode: 0644]