Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: bad error about missing import #48907

Closed
rsc opened this issue Oct 11, 2021 · 3 comments
Closed

cmd/go: bad error about missing import #48907

rsc opened this issue Oct 11, 2021 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Oct 11, 2021

I deleted cmd/internal/str and tried to build cmd/link. I get

% go build cmd
link/internal/ld/main.go:37:2: cannot find package "." in:
/Users/rsc/go/src/cmd/internal/str
%

There is no mention of an import of ".", so the message should not mention "." either.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 11, 2021
@rsc rsc added this to the Go1.18 milestone Oct 11, 2021
@gopherbot
Copy link

Change https://golang.org/cl/360615 mentions this issue: cmd/go: fix error message when missing import

@Jun10ng
Copy link
Contributor

Jun10ng commented Nov 6, 2021

https://golang.org/cl/360615 I am not sure if this change is correct, it seems that without modify test case file, I get an error when I run it.

  > ! go list -mod=vendor all
            [stderr]
            cannot find package "vendor/example.com/badedit" in:
                $WORK/gopath/src/vendor/example.com/badedit
            [exit status 1]
            > ! stderr '^go: inconsistent vendoring'
            > stderr 'cannot find package "\." in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$'
            FAIL: testdata/script/mod_go_version_missing.txt:30: no match for `(?m)cannot find package "\." in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$` found in stderr

It seems that should change this file.

@zhouguangyuan0718
Copy link
Contributor

https://golang.org/cl/360615 I am not sure if this change is correct, it seems that without modify test case file, I get an error when I run it.

  > ! go list -mod=vendor all
            [stderr]
            cannot find package "vendor/example.com/badedit" in:
                $WORK/gopath/src/vendor/example.com/badedit
            [exit status 1]
            > ! stderr '^go: inconsistent vendoring'
            > stderr 'cannot find package "\." in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$'
            FAIL: testdata/script/mod_go_version_missing.txt:30: no match for `(?m)cannot find package "\." in:\n\t.*[/\\]vendor[/\\]example.com[/\\]badedit$` found in stderr

It seems that should change this file.

Sorry,I can't run all.bash several days ago. I have updated this CL.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants