]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add support for 'go run pkg' or 'go run .'
authorRuss Cox <rsc@golang.org>
Wed, 25 Apr 2018 17:03:03 +0000 (13:03 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 10 May 2018 19:15:27 +0000 (19:15 +0000)
commit9ccfde6ee7df654be64a79c79ec4178c10d8fd18
tree5cbef9e1a203f2f166544b4f5fbaf0390cecaedc
parent670cb7603a02f4955d2b53176f9114a13b778062
cmd/go: add support for 'go run pkg' or 'go run .'

To date, go run has required a list of .go files.
This CL allows in place of that list a single import path
or a directory name or a pattern matching a single patckage.
This allows 'go run pkg' or 'go run dir', most importantly 'go run .'.

The discussion in #22726 gives more motivation.
The basic idea is that you can already run 'go test .'
but if you're developing a command it's pretty awkward
to iterate at the same speed. This lets you do that,
by using 'go run . [args]'.

Fixes #22726.

Change-Id: Ibfc8172a4f752588ad96df0a6b0928e9b61fa27f
Reviewed-on: https://go-review.googlesource.com/109341
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/alldocs.go
src/cmd/go/go_test.go
src/cmd/go/internal/run/run.go
src/cmd/go/testdata/src/hello/hello.go [new file with mode: 0644]