Skip to content

Commit a5c0b19

Browse files
zhouguangyuan0718odeke-em
authored andcommitted
cmd/go: fix error message when missing import
Fixes #48907 Change-Id: I504f846fc2ea655ba00aedb30f90847f938c347c Reviewed-on: https://go-review.googlesource.com/c/go/+/360615 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Trust: Emmanuel Odeke <[email protected]>
1 parent 1226547 commit a5c0b19

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/go/testdata/script/mod_go_version_missing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cmp go.mod go.mod.orig
2727

2828
! go list -mod=vendor all
2929
! stderr '^go: inconsistent vendoring'
30-
stderr 'cannot find package "\." in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$'
30+
stderr 'cannot find package "vendor/example.com/badedit" in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$'
3131

3232
# When we set -mod=mod, the go version should be updated immediately,
3333
# to the current version, converting the requirements from eager to lazy.

src/go/build/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ Found:
789789
}
790790

791791
// package was not found
792-
return p, fmt.Errorf("cannot find package %q in:\n\t%s", path, p.Dir)
792+
return p, fmt.Errorf("cannot find package %q in:\n\t%s", p.ImportPath, p.Dir)
793793
}
794794

795795
if mode&FindOnly != 0 {

0 commit comments

Comments
 (0)