Skip to content

Commit ab7435a

Browse files
cuonglmgopherbot
authored andcommitted
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>
1 parent 34ddde1 commit ab7435a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/cmd/compile/internal/noder/unified.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ func readPackage(pr *pkgReader, importpkg *types.Pkg, localStub bool) {
404404
r := pr.newReader(pkgbits.RelocMeta, pkgbits.PublicRootIdx, pkgbits.SyncPublic)
405405

406406
pkg := r.pkg()
407+
// This error can happen if "go tool compile" is called with wrong "-p" flag, see issue #54542.
407408
if pkg != importpkg {
408409
base.ErrorfAt(base.AutogeneratedPos, errors.BadImportPath, "mismatched import path, have %q (%p), want %q (%p)", pkg.Path, pkg, importpkg.Path, importpkg)
409410
base.ErrorExit()

0 commit comments

Comments
 (0)