Skip to content

Commit

Permalink
Fix comment and misc code issues
Browse files Browse the repository at this point in the history
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
  • Loading branch information
n4ss committed Mar 9, 2018
1 parent c5554f8 commit 8f98b14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions cli/command/trust/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import (

type inspectOptions struct {
remotes []string
/* FIXME(n4ss): this is consistent with `docker service inspect` but we should provide
* a `--format` flag too. (format and pretty-print should be exclusive)
*/
// FIXME(n4ss): this is consistent with `docker service inspect` but we should provide
// a `--format` flag too. (format and pretty-print should be exclusive)
prettyPrint bool
}

Expand Down Expand Up @@ -49,7 +48,7 @@ func runInspect(dockerCli command.Cli, opts inspectOptions) error {
}

// Additional separator between the inspection output of each image
if index < len(opts.remotes) - 1 {
if index < len(opts.remotes)-1 {
fmt.Fprint(dockerCli.Out(), "\n\n")
}
}
Expand Down
8 changes: 4 additions & 4 deletions cli/command/trust/inspect_pretty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/theupdateframework/notary/tuf/data"
)

/* TODO(n4ss): remove common tests with the regular inspect command */
// TODO(n4ss): remove common tests with the regular inspect command

type fakeClient struct {
dockerClient.Client
Expand Down Expand Up @@ -65,7 +65,7 @@ func TestTrustInspectPrettyCommandOfflineErrors(t *testing.T) {

cli = test.NewFakeCli(&fakeClient{})
cli.SetNotaryClient(notaryfake.GetOfflineNotaryRepository)
cmd := newInspectCommand(cli)
cmd = newInspectCommand(cli)
cmd.Flags().Set("pretty", "true")
cmd.SetArgs([]string{"nonexistent-reg-name.io/image:tag"})
cmd.SetOutput(ioutil.Discard)
Expand All @@ -83,7 +83,7 @@ func TestTrustInspectPrettyCommandUninitializedErrors(t *testing.T) {

cli = test.NewFakeCli(&fakeClient{})
cli.SetNotaryClient(notaryfake.GetUninitializedNotaryRepository)
cmd := newInspectCommand(cli)
cmd = newInspectCommand(cli)
cmd.Flags().Set("pretty", "true")
cmd.SetArgs([]string{"reg/unsigned-img:tag"})
cmd.SetOutput(ioutil.Discard)
Expand All @@ -103,7 +103,7 @@ func TestTrustInspectPrettyCommandEmptyNotaryRepoErrors(t *testing.T) {

cli = test.NewFakeCli(&fakeClient{})
cli.SetNotaryClient(notaryfake.GetEmptyTargetsNotaryRepository)
cmd := newInspectCommand(cli)
cmd = newInspectCommand(cli)
cmd.Flags().Set("pretty", "true")
cmd.SetArgs([]string{"reg/img"})
cmd.SetOutput(ioutil.Discard)
Expand Down

0 comments on commit 8f98b14

Please sign in to comment.