diff --git a/cmd/helm/list.go b/cmd/helm/list.go index cec17a245..b71278c7c 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -29,7 +29,6 @@ import ( "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/cli/output" "helm.sh/helm/v3/pkg/release" - helmtime "helm.sh/helm/v3/pkg/time" ) var listHelp = ` @@ -165,7 +164,7 @@ func newReleaseListWriter(releases []*release.Release, timeFormat string) *relea t := "-" if tspb := r.Info.LastDeployed; !tspb.IsZero() { if timeFormat != "" { - t = helmtime.Format(tspb, timeFormat) + t = tspb.Format(timeFormat) } else { t = tspb.String() } diff --git a/pkg/time/time.go b/pkg/time/time.go index 3309da735..44f3fedfb 100644 --- a/pkg/time/time.go +++ b/pkg/time/time.go @@ -89,8 +89,3 @@ func (t Time) Round(d time.Duration) Time { return Time{Time: t.Time.Round(d) func (t Time) Sub(u Time) time.Duration { return t.Time.Sub(u.Time) } func (t Time) Truncate(d time.Duration) Time { return Time{Time: t.Time.Truncate(d)} } func (t Time) UTC() Time { return Time{Time: t.Time.UTC()} } - -// Format formats time in custom output format -func Format(t Time, format string) string { - return t.Format(format) -} diff --git a/pkg/time/time_test.go b/pkg/time/time_test.go index 35c719033..20f0f8e29 100644 --- a/pkg/time/time_test.go +++ b/pkg/time/time_test.go @@ -81,19 +81,3 @@ func TestZeroValueUnmarshal(t *testing.T) { t.Errorf("expected time to be equal to zero value, got %v", myTime) } } - -func TestFormat(t *testing.T) { - when := Date(2009, 11, 17, 20, 34, 58, 651387237, time.UTC) - - expected := "2009-11-17 20:34:58 +0000 UTC" - got := Format(when, "2006-01-02 15:04:05 -0700 MST") - if expected != got { - t.Errorf("expected %s, got %s", expected, got) - } - - expected = "2009-11-17 20:34 +0000 UTC" - got = Format(when, "2006-01-02 15:04 -0700 MST") - if expected != got { - t.Errorf("expected %s, got %s", expected, got) - } -}