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

Issue 8119049: code review 8119049: cmd/go: allow run if non-test files are listed (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by titanous
Modified:
10 years, 2 months ago
Reviewers:
minux1, rsc, 0xjnml, r, hightower, adg, dave
CC:
golang-dev, iant, adg
Visibility:
Public.

Description

cmd/go: run main package when no files are listed Fixes 5164.

Patch Set 1 #

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

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

Patch Set 4 : diff -r 56b570509242 https://code.google.com/p/go/ #

Total comments: 2

Patch Set 5 : diff -r 56b570509242 https://code.google.com/p/go/ #

Patch Set 6 : diff -r 56b570509242 https://code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 56b570509242 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -3 lines) Patch
M doc/go1.1.html View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M src/cmd/go/doc.go View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M src/cmd/go/run.go View 1 2 3 4 2 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 25
titanous
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 1 month ago (2013-03-30 23:30:31 UTC) #1
iant
It's hard for me to convince myself that it's a good idea to ignore files ...
11 years, 1 month ago (2013-03-31 03:25:29 UTC) #2
titanous
On 2013/03/31 03:25:29, iant wrote: > It's hard for me to convince myself that it's ...
11 years, 1 month ago (2013-03-31 13:51:10 UTC) #3
iant
On 2013/03/31 13:51:10, titanous wrote: > On 2013/03/31 03:25:29, iant wrote: > > It's hard ...
11 years, 1 month ago (2013-03-31 22:35:38 UTC) #4
titanous
On 2013/03/31 22:35:38, iant wrote: > On 2013/03/31 13:51:10, titanous wrote: > > On 2013/03/31 ...
11 years, 1 month ago (2013-03-31 22:46:44 UTC) #5
iant
On 2013/03/31 22:46:44, titanous wrote: > On 2013/03/31 22:35:38, iant wrote: > > On 2013/03/31 ...
11 years, 1 month ago (2013-03-31 22:51:02 UTC) #6
titanous
On 2013/03/31 22:51:02, iant wrote: > On 2013/03/31 22:46:44, titanous wrote: > > On 2013/03/31 ...
11 years, 1 month ago (2013-03-31 22:51:41 UTC) #7
titanous
I've added a naive implementation of the described functionality. Please let me know if there's ...
11 years, 1 month ago (2013-03-31 23:14:36 UTC) #8
adg
This needs a corresponding documentation change. The code looks ok to me.
11 years, 1 month ago (2013-04-03 22:06:25 UTC) #9
titanous
On 2013/04/03 22:06:25, adg wrote: > This needs a corresponding documentation change. The code looks ...
11 years, 1 month ago (2013-04-03 22:42:56 UTC) #10
adg
https://codereview.appspot.com/8119049/diff/17001/doc/go1.1.html File doc/go1.1.html (right): https://codereview.appspot.com/8119049/diff/17001/doc/go1.1.html#newcode400 doc/go1.1.html:400: an error is now returned if they are listed. ...
11 years, 1 month ago (2013-04-03 22:54:55 UTC) #11
titanous
On 2013/04/03 22:54:55, adg wrote: > https://codereview.appspot.com/8119049/diff/17001/doc/go1.1.html > File doc/go1.1.html (right): > > https://codereview.appspot.com/8119049/diff/17001/doc/go1.1.html#newcode400 > ...
11 years, 1 month ago (2013-04-03 22:58:14 UTC) #12
adg
https://codereview.appspot.com/8119049/diff/15002/doc/go1.1.html File doc/go1.1.html (right): https://codereview.appspot.com/8119049/diff/15002/doc/go1.1.html#newcode399 doc/go1.1.html:399: directory if no file arguments are listed. Because test ...
11 years, 1 month ago (2013-04-04 00:47:02 UTC) #13
titanous
On 2013/04/04 00:47:02, adg wrote: > https://codereview.appspot.com/8119049/diff/15002/doc/go1.1.html > File doc/go1.1.html (right): > > https://codereview.appspot.com/8119049/diff/15002/doc/go1.1.html#newcode399 > ...
11 years, 1 month ago (2013-04-04 00:58:48 UTC) #14
adg
LGTM Thanks!
11 years, 1 month ago (2013-04-04 01:03:48 UTC) #15
adg
*** Submitted as https://code.google.com/p/go/source/detail?r=2fc72d55ed99 *** cmd/go: run main package when no files are listed Fixes ...
11 years, 1 month ago (2013-04-04 01:04:42 UTC) #16
minux1
i'm a little worried by this change. i think we shouldn't enhance "go run" beyond ...
11 years, 1 month ago (2013-04-04 07:14:44 UTC) #17
dave_cheney.net
I second this concern. On Thu, Apr 4, 2013 at 6:14 PM, minux <minux.ma@gmail.com> wrote: ...
11 years, 1 month ago (2013-04-04 07:15:12 UTC) #18
0xjnml
On Thu, Apr 4, 2013 at 9:15 AM, Dave Cheney <dave@cheney.net> wrote: > I second ...
11 years, 1 month ago (2013-04-04 07:18:03 UTC) #19
iant
On Thu, Apr 4, 2013 at 12:14 AM, minux <minux.ma@gmail.com> wrote: > i'm a little ...
11 years, 1 month ago (2013-04-04 17:41:27 UTC) #20
r
I'm fine with "go run", and believe that if it's there, it should behave like ...
11 years, 1 month ago (2013-04-04 18:13:27 UTC) #21
adg
I doesn't quite behave like "go build", as I don't think it will build c ...
11 years, 1 month ago (2013-04-04 20:55:58 UTC) #22
rsc
I would like to revert this CL for Go 1.1. This makes the 'go run' ...
11 years ago (2013-04-29 18:35:14 UTC) #23
r
As you can see from the comments, this one took a while to sort out, ...
11 years ago (2013-04-29 18:38:51 UTC) #24
hightower
10 years, 2 months ago (2014-03-10 02:13:57 UTC) #25
Message was sent while issue was closed.
On 2013/04/29 18:35:14, rsc wrote:
> I would like to revert this CL for Go 1.1.
> 
> This makes the 'go run' command different from every other command.
> For example, 'go test' does not mean 'go test *.go'.
> 
> If we were going to handle the no arguments case in 'go run', I would hope
that
> it would scan the current directory to find a package just like 'go build' or
> 'go test' would, and then it would require that package to be 'package main',
> and then it would run that package. This would make it match 'go test' and 'go
> build' and 'go install' and so on. It would mean that if you are working on a
> command in a directory that is 'go install'able, then 'go run' will run the
> binary for you. The current CL does not accomplish that when build constraints
> or file name constraints are involved.
> 
> For example, if I am working on a program like:
> 
> $ ls
> main.go
> main_386.s
> main_arm.s
> main_amd64.s
> $ 
> 
> Then 'go run' will fail here because the .s files are ignored.
> 
> If instead I am working on a program like:
> 
> $ ls
> main.go
> main_386.go
> main_arm.go
> main_amd64.go
> $ 
> 
> then 'go run' will fail because too many files are included. 
> 
> I would like to see this command implemented so that it is compatible with the
> other go subcommands. Since it is too late to do that for Go 1.1, I would like
> to see this CL reverted, to preserve the option to do it better later.

I've submitted a CL: https://codereview.appspot.com/73350043 that works as
outlined above.
Sign in to reply to this message.

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