From ce9d704b51642245faad3a77e9e176a2ac3eddb5 Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Tue, 17 Oct 2023 13:08:34 -0700 Subject: [PATCH] Rename struct to avoid stutter in naming --- internal/pkg/agent/application/upgrade/details/details.go | 8 ++++---- .../pkg/agent/application/upgrade/details/details_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/pkg/agent/application/upgrade/details/details.go b/internal/pkg/agent/application/upgrade/details/details.go index 9f8d243503a..c769ea9a5df 100644 --- a/internal/pkg/agent/application/upgrade/details/details.go +++ b/internal/pkg/agent/application/upgrade/details/details.go @@ -17,14 +17,14 @@ type Details struct { TargetVersion string State State ActionID string - Metadata DetailsMetadata + Metadata Metadata observers []Observer mu sync.Mutex } -// DetailsMetadata consists of metadata relating to a specific upgrade state -type DetailsMetadata struct { +// Metadata consists of metadata relating to a specific upgrade state +type Metadata struct { ScheduledAt time.Time DownloadPercent float64 DownloadRate float64 @@ -45,7 +45,7 @@ func NewDetails(targetVersion string, initialState State, actionID string) *Deta TargetVersion: targetVersion, State: initialState, ActionID: actionID, - Metadata: DetailsMetadata{}, + Metadata: Metadata{}, observers: []Observer{}, } } diff --git a/internal/pkg/agent/application/upgrade/details/details_test.go b/internal/pkg/agent/application/upgrade/details/details_test.go index 1c196fe8f93..cf572fb42dd 100644 --- a/internal/pkg/agent/application/upgrade/details/details_test.go +++ b/internal/pkg/agent/application/upgrade/details/details_test.go @@ -16,7 +16,7 @@ func TestDetailsNew(t *testing.T) { require.Equal(t, StateRequested, det.State) require.Equal(t, "99.999.9999", det.TargetVersion) require.Equal(t, "test_action_id", det.ActionID) - require.Equal(t, DetailsMetadata{}, det.Metadata) + require.Equal(t, Metadata{}, det.Metadata) } func TestDetailsSetState(t *testing.T) {