Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2437)

Issue 73350043: code review 73350043: cmd/go: run main package when no files are listed (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by hightower
Modified:
10 years, 1 month ago
Visibility:
Public.

Description

cmd/go: run main package when no files are listed The go run command requires a list of Go source files that comprise the main package, which are then compiled and run. A pattern such as '*.go' can be used to satisfy the Go source file argument, but doing so often leads to the following error: go run: cannot run *_test.go files (*_test.go) In many cases the above error is unavoidable because test files are often found in same directory as the main package. The go run command is inconsistent when compared to other commands. For example, the go test command needs no arguments, compiles and tests the package with source in the current directory by default. Modify the go run command to make the Go source files argument optional. With no arguments go run scans the current directory for package main. If package main is located, compile and run it, if not go run exits non-zero and prints the following error message: go run: cannot locate main package Fixes issue 5164.

Patch Set 1 #

Patch Set 2 : diff -r 1849f83423ca https://code.google.com/p/go #

Patch Set 3 : diff -r 1849f83423ca https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -10 lines) Patch
M src/cmd/go/run.go View 1 2 chunks +26 lines, -10 lines 0 comments Download

Messages

Total messages: 4
hightower
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
10 years, 2 months ago (2014-03-10 02:28:43 UTC) #1
minux1
Did you know about https://codereview.appspot.com/50970043/?
10 years, 2 months ago (2014-03-10 02:31:44 UTC) #2
hightower
On 2014/03/10 02:31:44, minux wrote: > Did you know about https://codereview.appspot.com/50970043/ No. If this is ...
10 years, 2 months ago (2014-03-10 02:39:44 UTC) #3
hightower
10 years, 1 month ago (2014-03-16 06:53:33 UTC) #4
*** Abandoned ***
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b