aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/noder/unified.go
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2024-07-03 22:46:30 +0700
committerGopher Robot <gobot@golang.org>2024-07-31 19:54:27 +0000
commitab7435abd9db52732d2d1d3494aae669d91937f1 (patch)
tree8fb22f636c77fc058d6e93ffd7d6672d06c0f252 /src/cmd/compile/internal/noder/unified.go
parent34ddde165d770e0a0dbca1bd64260ed878eb48c8 (diff)
downloadgo-ab7435abd9db52732d2d1d3494aae669d91937f1.tar.xz
cmd/compile: add comment for the context on mismatch import path
Follow up suggestion in CL 596396. Updates #54542 Change-Id: I47bf66684bb8397dc1cfbc4479e2279e59a40cfb Reviewed-on: https://go-review.googlesource.com/c/go/+/596515 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/noder/unified.go')
-rw-r--r--src/cmd/compile/internal/noder/unified.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/unified.go b/src/cmd/compile/internal/noder/unified.go
index 6bc23cc5f9..a5f0974838 100644
--- a/src/cmd/compile/internal/noder/unified.go
+++ b/src/cmd/compile/internal/noder/unified.go
@@ -404,6 +404,7 @@ func readPackage(pr *pkgReader, importpkg *types.Pkg, localStub bool) {
r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic)
pkg := r.pkg()
+ // This error can happen if "go tool compile" is called with wrong "-p" flag, see issue #54542.
if pkg != importpkg {
base.ErrorfAt(base.AutogeneratedPos, errors.BadImportPath, "mismatched import path, have %q (%p), want %q (%p)", pkg.Path, pkg, importpkg.Path, importpkg)
base.ErrorExit()