From 6453c992415d154061ee09ae736682143a59ed7c Mon Sep 17 00:00:00 2001 From: Adam Reese Date: Tue, 28 Jun 2016 23:19:51 -0700 Subject: [PATCH] fix(cmd): rename list cmd context --- cmd/helm/list.go | 6 +++--- cmd/helm/list_test.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/helm/list.go b/cmd/helm/list.go index 42537a71f..0bc454266 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -53,7 +53,7 @@ server's default, which may be much higher than 256. Pairing the '--max' flag with the '--offset' flag allows you to page through results. ` -type lister struct { +type listCmd struct { filter string long bool limit int @@ -65,7 +65,7 @@ type lister struct { } func newListCmd(client helm.Interface, out io.Writer) *cobra.Command { - list := &lister{out: out} + list := &listCmd{out: out} cmd := &cobra.Command{ Use: "list [flags] [FILTER]", Short: "list releases", @@ -91,7 +91,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command { return cmd } -func (l *lister) run() error { +func (l *listCmd) run() error { sortBy := services.ListSort_NAME if l.byDate { sortBy = services.ListSort_LAST_RELEASED diff --git a/cmd/helm/list_test.go b/cmd/helm/list_test.go index 56eee07f3..dace068f7 100644 --- a/cmd/helm/list_test.go +++ b/cmd/helm/list_test.go @@ -51,13 +51,13 @@ func (fl *fakeReleaseLister) ListReleases(opts ...helm.ReleaseListOption) (*rls. func TestListRun(t *testing.T) { tests := []struct { name string - lister *lister + listCmd *listCmd expected string err bool }{ { name: "with a release", - lister: &lister{ + listCmd: &listCmd{ client: &fakeReleaseLister{ rels: []*release.Release{ releaseMock("thomas-guide"), @@ -68,7 +68,7 @@ func TestListRun(t *testing.T) { }, { name: "list --long", - lister: &lister{ + listCmd: &listCmd{ client: &fakeReleaseLister{ rels: []*release.Release{ releaseMock("atlas"), @@ -82,8 +82,8 @@ func TestListRun(t *testing.T) { var buf bytes.Buffer for _, tt := range tests { - tt.lister.out = &buf - err := tt.lister.run() + tt.listCmd.out = &buf + err := tt.listCmd.run() if (err != nil) != tt.err { t.Errorf("%q. expected error: %v, got %v", tt.name, tt.err, err) }