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

Issue 156103: code review 156103: gofmt: add -r flag to rewrite source code according to ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 4 months ago by rsc
Modified:
15 years, 4 months ago
Reviewers:
gri
Visibility:
Public.

Description

gofmt: add -r flag to rewrite source code according to pattern a little slow, but usable (speed unchanged when not using -r) tweak go/printer to handle nodes without line numbers more gracefully in a couple cases.

Patch Set 1 #

Patch Set 2 : code review 156103: gofmt: add -r flag to rewrite source code according to ... #

Patch Set 3 : code review 156103: gofmt: add -r flag to rewrite source code according to ... #

Total comments: 29

Patch Set 4 : code review 156103: gofmt: add -r flag to rewrite source code according to ... #

Total comments: 2

Patch Set 5 : code review 156103: gofmt: add -r flag to rewrite source code according to ... #

Patch Set 6 : code review 156103: gofmt: add -r flag to rewrite source code according to ... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+252 lines, -5 lines) Patch
M src/cmd/gofmt/Makefile View 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gofmt/gofmt.go View 1 2 3 4 5 5 chunks +12 lines, -2 lines 0 comments Download
A src/cmd/gofmt/rewrite.go View 3 4 5 1 chunk +226 lines, -0 lines 0 comments Download
M src/pkg/go/printer/nodes.go View 1 2 3 4 3 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 6
rsc
Hello gri, I'd like you to review the following change.
15 years, 4 months ago (2009-11-20 02:05:54 UTC) #1
rsc
Added rewrite.go to this CL.
15 years, 4 months ago (2009-11-20 02:16:53 UTC) #2
gri
Pretty cool! http://codereview.appspot.com/156103/diff/8/1010 File src/cmd/gofmt/gofmt.go (right): http://codereview.appspot.com/156103/diff/8/1010#newcode26 src/cmd/gofmt/gofmt.go:26: rewriteString = flag.String("r", "", "rewrite pattern (e.g., ...
15 years, 4 months ago (2009-11-20 18:22:51 UTC) #3
rsc
http://codereview.appspot.com/156103/diff/8/1011 File src/cmd/gofmt/rewrite.go (right): http://codereview.appspot.com/156103/diff/8/1011#newcode1 src/cmd/gofmt/rewrite.go:1: package main On 2009/11/20 18:22:51, gri wrote: > Missing ...
15 years, 4 months ago (2009-11-20 21:43:25 UTC) #4
gri
LGTM http://codereview.appspot.com/156103/diff/2002/2005 File src/cmd/gofmt/rewrite.go (right): http://codereview.appspot.com/156103/diff/2002/2005#newcode63 src/cmd/gofmt/rewrite.go:63: var f func(val reflect.Value) reflect.Value; // f is ...
15 years, 4 months ago (2009-11-20 23:01:51 UTC) #5
rsc
15 years, 4 months ago (2009-11-20 23:09:56 UTC) #6
*** Submitted as http://code.google.com/p/go/source/detail?r=856aaa765cc9 ***

gofmt: add -r flag to rewrite source code according to pattern
a little slow, but usable (speed unchanged when not using -r)

tweak go/printer to handle nodes without line numbers
more gracefully in a couple cases.

R=gri
http://codereview.appspot.com/156103
Sign in to reply to this message.

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