You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should be able to point go run to a directory, as an alternative to a list of gofiles..., and run the whole directory.
It would be great if go run ./program or just go run . to execute the program in current working directory. go tool can easily detect if an argument is a go file or directory specification, then it can discover the go source files (excl. _test.go files) on the directory and then pass it as the gofiles... arg to the actual go run.
This has been previously reported at various forums:
What version of Go are you using (
go version
)?1.8.1
Problem
When I want to run a Go program that is in
./app/
directory in my dev/test cycle, I have the following options:go build -o a.out ./program && ./a.out
: I don't want to have binary files laying aroundgo install ./program && $GOPATH/program
: it takes two steps and too long to type.cd program; go run *.go
: this doesn't work when I have_test.go
files. (cmd/go: allow "go run" to run command in current directory #5164)I think we should be able to point
go run
to a directory, as an alternative to a list ofgofiles...
, and run the whole directory.It would be great if
go run ./program
or justgo run .
to execute the program in current working directory. go tool can easily detect if an argument is a go file or directory specification, then it can discover the go source files (excl. _test.go files) on the directory and then pass it as thegofiles...
arg to the actualgo run
.This has been previously reported at various forums:
I am opening a new issue to see if there is interest, or if the feasibility of making this change has changed in the meanwhile.
The text was updated successfully, but these errors were encountered: