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: confusing error for non-existent go source files #48559

Open
rsc opened this issue Sep 22, 2021 · 2 comments
Open

cmd/go: confusing error for non-existent go source files #48559

rsc opened this issue Sep 22, 2021 · 2 comments

Comments

@rsc
Copy link
Contributor

@rsc rsc commented Sep 22, 2021

% go build notexist.go
cannot find package "." in:
	/Users/rsc/go/src/notexist.go
% 

For what it's worth, I'm not in /Users/rsc/go/src.
That's just the error looking for a std package named notexist.go.
It should show me an error more like 'no such file notexist.go'.

/cc @bcmills @jayconrod @matloob

@rsc rsc added this to the Go1.18 milestone Sep 22, 2021
@robpike robpike changed the title cmd/go: confusing error for non-existant go source files cmd/go: confusing error for non-existent go source files Sep 22, 2021
@heschi
Copy link
Contributor

@heschi heschi commented Oct 6, 2021

Ping from the release team: any updates on this release blocker?

@heschi heschi closed this Oct 6, 2021
@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Oct 6, 2021

Briefly looked into this, but wasn't able to reproduce it. Outside a module in 1.17.1, I see this:

$ go build notexist.go
no required module provides package notexist.go: go.mod file not found in current directory or any parent directory; see 'go help modules'

Inside a module:

$ go build notexist.go
no required module provides package notexist.go; to add it:
        go get notexist.go

What version of Go was this? What does go env show?

@jayconrod jayconrod reopened this Oct 6, 2021
@bcmills bcmills self-assigned this Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants