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: run unable to start file that begins with period #36045

Closed
nektro opened this issue Dec 8, 2019 · 4 comments
Closed

cmd/go: run unable to start file that begins with period #36045

nektro opened this issue Dec 8, 2019 · 4 comments

Comments

@nektro
Copy link

@nektro nektro commented Dec 8, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.7 linux/amd64

Does this issue reproduce with the latest release?

Untested.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/meghan/snap/code/common/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/meghan/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build591367948=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go run etc/.test.go

What did you expect to see?

The output of the program.

What did you see instead?

package main: no Go files in /home/meghan/dev/go/scratch/etc
@AlexRouSg

This comment has been minimized.

Copy link
Contributor

@AlexRouSg AlexRouSg commented Dec 8, 2019

https://golang.org/cmd/go/#hdr-Package_lists_and_patterns

Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".

@ALTree

This comment has been minimized.

Copy link
Member

@ALTree ALTree commented Dec 8, 2019

What @AlexRouSg said. Closing here.

@ALTree ALTree closed this Dec 8, 2019
@nektro

This comment has been minimized.

Copy link
Author

@nektro nektro commented Dec 8, 2019

Do you not feel that go runing a specific file should be an exception to this rule? I would assume as a user that that definition only refers to other files and packages.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 8, 2019

The current behavior is working as documented. We could consider changing the behavior. But I can't see a use for Go files whose name starts with a period, so it doesn't seem like a priority.

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
4 participants
You can’t perform that action at this time.