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

Issue 6426043: cmd: move jujuc/server/output.go to cmd/ (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by dave
Modified:
11 years, 9 months ago
Reviewers:
mp+115500
Visibility:
Public.

Description

cmd: move jujuc/server/output.go to cmd/ This proposal moves most* of output.go up two levels so it can be reused by juju status. * testMode remains in jujuc/server in server.go https://code.launchpad.net/~dave-cheney/juju-core/go-cmd-output/+merge/115500 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : cmd: move jujuc/server/output.go to cmd/ #

Patch Set 3 : cmd: move jujuc/server/output.go to cmd/ #

Total comments: 10

Patch Set 4 : cmd: move jujuc/server/output.go to cmd/ #

Patch Set 5 : cmd: move jujuc/server/output.go to cmd/ #

Total comments: 6

Patch Set 6 : cmd: move jujuc/server/output.go to cmd/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -61 lines) Patch
A [revision details] View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujuc/server/config-get.go View 1 3 chunks +7 lines, -5 lines 0 comments Download
M cmd/jujuc/server/server.go View 2 chunks +28 lines, -0 lines 0 comments Download
M cmd/jujuc/server/unit-get.go View 1 3 chunks +7 lines, -5 lines 0 comments Download
M cmd/output.go View 1 2 3 4 5 7 chunks +19 lines, -51 lines 0 comments Download
A cmd/output_test.go View 1 2 3 4 1 chunk +71 lines, -0 lines 0 comments Download

Messages

Total messages: 6
fwereade
Move LGTM, but please write a simple test or two now that it's exposed.
11 years, 9 months ago (2012-07-18 09:57:21 UTC) #1
dave_cheney.net
Please take a look.
11 years, 9 months ago (2012-07-18 10:50:43 UTC) #2
rog
LGTM, with a few minor suggestions below. https://codereview.appspot.com/6426043/diff/3006/cmd/output.go File cmd/output.go (right): https://codereview.appspot.com/6426043/diff/3006/cmd/output.go#newcode25 cmd/output.go:25: // DefaultFormatters ...
11 years, 9 months ago (2012-07-18 11:06:07 UTC) #3
dave_cheney.net
Please take a look. https://codereview.appspot.com/6426043/diff/3006/cmd/output.go File cmd/output.go (right): https://codereview.appspot.com/6426043/diff/3006/cmd/output.go#newcode25 cmd/output.go:25: // DefaultFormatters are used by ...
11 years, 9 months ago (2012-07-18 11:18:02 UTC) #4
niemeyer
Very nice. LGTM, with three trivials: https://codereview.appspot.com/6426043/diff/8001/cmd/output.go File cmd/output.go (right): https://codereview.appspot.com/6426043/diff/8001/cmd/output.go#newcode81 cmd/output.go:81: // The zero ...
11 years, 9 months ago (2012-07-18 18:56:50 UTC) #5
dave_cheney.net
11 years, 9 months ago (2012-07-18 21:47:04 UTC) #6
*** Submitted:

cmd: move jujuc/server/output.go to cmd/

This proposal moves most* of output.go up two levels 
so it can be reused by juju status.

* testMode remains in jujuc/server in server.go

R=fwereade, rog, niemeyer
CC=
https://codereview.appspot.com/6426043

https://codereview.appspot.com/6426043/diff/8001/cmd/output.go
File cmd/output.go (right):

https://codereview.appspot.com/6426043/diff/8001/cmd/output.go#newcode81
cmd/output.go:81: // The zero value is ready to use.
On 2012/07/18 18:56:50, niemeyer wrote:
> 
> What does "ready to use" mean?
> 
> // The zero Output value <explanation of what it does>

This was a suggestion from Roger. The zero value does what it is supposed to do,
so probably doesn't need further explanation.

https://codereview.appspot.com/6426043/diff/8001/cmd/output.go#newcode88
cmd/output.go:88: func (c *Output) AddFlags(f *gnuflag.FlagSet, name string,
formatters map[string]Formatter) {
On 2012/07/18 18:56:50, niemeyer wrote:
> 
> s/name/defaultFormatter/

Done.

https://codereview.appspot.com/6426043/diff/8001/cmd/output.go#newcode112
cmd/output.go:112: _, err = target.Write(append(bytes, '\n'))
On 2012/07/18 18:56:50, niemeyer wrote:
> 
> The original logic was more sensible. Reallocating len(bytes)+1 and copying
> len(bytes) just to add a '\n' is quite a bit of waste just to avoid calling
the
> function again.

Reverted.
Sign in to reply to this message.

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