Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 466bb30

Browse files
mattnsdboyer
authored andcommitted
fixes for reviews
1 parent 9bb5c62 commit 466bb30

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cmd/dep/status.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type statusCommand struct {
6767
modified bool
6868
}
6969

70-
type Outputter interface {
70+
type outputter interface {
7171
BasicHeader()
7272
BasicLine(*BasicStatus)
7373
BasicFooter()
@@ -147,7 +147,7 @@ func (out *jsonOutput) MissingLine(ms *MissingStatus) {
147147
}
148148

149149
func (out *jsonOutput) MissingFooter() {
150-
json.NewEncoder(os.Stdout).Encode(out.missing)
150+
json.NewEncoder(out.w).Encode(out.missing)
151151
}
152152

153153
func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
@@ -163,15 +163,15 @@ func (cmd *statusCommand) Run(ctx *dep.Ctx, args []string) error {
163163
sm.UseDefaultSignalHandling()
164164
defer sm.Release()
165165

166-
var out Outputter
167-
if cmd.detailed {
166+
var out outputter
167+
switch {
168+
case cmd.detailed:
168169
return fmt.Errorf("not implemented")
169-
}
170-
if cmd.json {
170+
case cmd.json:
171171
out = &jsonOutput{
172172
w: os.Stdout,
173173
}
174-
} else {
174+
default:
175175
out = &tableOutput{
176176
w: tabwriter.NewWriter(os.Stdout, 0, 4, 2, ' ', 0),
177177
}
@@ -195,7 +195,7 @@ type MissingStatus struct {
195195
MissingPackages []string
196196
}
197197

198-
func runStatusAll(out Outputter, p *dep.Project, sm *gps.SourceMgr) error {
198+
func runStatusAll(out outputter, p *dep.Project, sm *gps.SourceMgr) error {
199199
if p.Lock == nil {
200200
// TODO if we have no lock file, do...other stuff
201201
return nil

0 commit comments

Comments
 (0)