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

go/build: not documented that files with leading underscore are ignored #7909

Closed
gopherbot opened this issue Apr 30, 2014 · 8 comments
Closed

Comments

@gopherbot
Copy link

by ibit.zee:

go version go1.2.1 windows/386

command line is : go run _test1.go
error is : no buildable Go source files in C:\APL\!PROGRAMMING\GO

the problem is the underscore (_) in the file name, causes the file to not be found...

ZEE ;-)
@ianlancetaylor
Copy link
Contributor

Comment 1:

This is intentional.  Files whose names start with '_' or '.' are ignored (an underscore
elsewhere in the file name is OK).
However, I can't find any documentation for that, so changing this to a documentation
issue.

Labels changed: added repo-main, release-go1.3maybe, documentation.

Status changed to Accepted.

@alexbrainman
Copy link
Member

Comment 2:

ibit.zee,
Why "!" in "C:\APL\!PROGRAMMING\GO"? Is that intentional?
Alex

@minux
Copy link
Member

minux commented May 1, 2014

Comment 3:

it's documented:
http://golang.org/pkg/go/build/#Context.Import

@cespare
Copy link
Contributor

cespare commented May 1, 2014

Comment 4:

The relevant documentation is here:
http://golang.org/cmd/go/#hdr-Description_of_package_lists
"File names that begin with "." or "_" are ignored by the go tool."
#3: That is for the go/build package, not the go tool.

@minux
Copy link
Member

minux commented May 2, 2014

Comment 5:

the summary of the issue says this issue targets "go/build", not cmd/go, i was replying
to that.
also, cmd/go does point to go/build.

@minux
Copy link
Member

minux commented May 2, 2014

Comment 6:

Status changed to Duplicate.

Merged into issue #5655.

@gopherbot
Copy link
Author

Comment 7 by anonymouzee:

A file starting with underscore '_' (or any other char, as in other main languages)
should be valid!
?why not... ?is there a compeling reason

@ianlancetaylor
Copy link
Contributor

Comment 8:

A closed issue is not the right place for discussion of behaviour that is documented and
implemented.  Bring it up on the mailing list.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants