Skip to content

Commit da7541a

Browse files
rename result Platform in PlatformSummary
1 parent 3ae9dee commit da7541a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

internal/cli/core/list.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSu
9191
func newCoreListResult(in []*rpc.PlatformSummary) *coreListResult {
9292
res := &coreListResult{}
9393
for _, platformSummary := range in {
94-
res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary))
94+
res.platforms = append(res.platforms, result.NewPlatformSummary(platformSummary))
9595
}
9696
return res
9797
}
9898

9999
type coreListResult struct {
100-
platforms []*result.Platform
100+
platforms []*result.PlatformSummary
101101
}
102102

103103
// Data implements Result interface

internal/cli/core/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ func runSearchCommand(cmd *cobra.Command, args []string) {
8888
// output from this command requires special formatting, let's create a dedicated
8989
// feedback.Result implementation
9090
type searchResults struct {
91-
platforms []*result.Platform
91+
platforms []*result.PlatformSummary
9292
}
9393

9494
func newSearchResult(in []*rpc.PlatformSummary) *searchResults {
9595
res := &searchResults{}
9696
for _, platformSummary := range in {
97-
res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary))
97+
res.platforms = append(res.platforms, result.NewPlatformSummary(platformSummary))
9898
}
9999
return res
100100
}

internal/cli/feedback/result/rpc.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ import (
2323
semver "go.bug.st/relaxed-semver"
2424
)
2525

26-
// NewPlatformResult creates a new result.Platform from rpc.PlatformSummary
27-
func NewPlatformResult(in *rpc.PlatformSummary) *Platform {
26+
// NewPlatformSummary creates a new result.Platform from rpc.PlatformSummary
27+
func NewPlatformSummary(in *rpc.PlatformSummary) *PlatformSummary {
2828
releases := orderedmap.NewWithConversionFunc[*semver.Version, *PlatformRelease, string]((*semver.Version).String)
2929
for k, v := range in.Releases {
3030
releases.Set(semver.MustParse(k), NewPlatformReleaseResult(v))
3131
}
3232
releases.SortKeys((*semver.Version).CompareTo)
3333

34-
return &Platform{
34+
return &PlatformSummary{
3535
Id: in.Metadata.Id,
3636
Maintainer: in.Metadata.Maintainer,
3737
Website: in.Metadata.Website,
@@ -45,8 +45,8 @@ func NewPlatformResult(in *rpc.PlatformSummary) *Platform {
4545
}
4646
}
4747

48-
// Platform maps a rpc.Platform
49-
type Platform struct {
48+
// PlatformSummary maps a rpc.PlatformSummary
49+
type PlatformSummary struct {
5050
Id string `json:"id,omitempty"`
5151
Maintainer string `json:"maintainer,omitempty"`
5252
Website string `json:"website,omitempty"`
@@ -62,12 +62,12 @@ type Platform struct {
6262
}
6363

6464
// GetLatestRelease returns the latest relase of this platform or nil if none available.
65-
func (p *Platform) GetLatestRelease() *PlatformRelease {
65+
func (p *PlatformSummary) GetLatestRelease() *PlatformRelease {
6666
return p.Releases.Get(p.LatestVersion)
6767
}
6868

6969
// GetInstalledRelease returns the installed relase of this platform or nil if none available.
70-
func (p *Platform) GetInstalledRelease() *PlatformRelease {
70+
func (p *PlatformSummary) GetInstalledRelease() *PlatformRelease {
7171
return p.Releases.Get(p.InstalledVersion)
7272
}
7373

internal/cli/outdated/outdated.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ func Outdated(inst *rpc.Instance) {
6565
// output from this command requires special formatting, let's create a dedicated
6666
// feedback.Result implementation
6767
type outdatedResult struct {
68-
Platforms []*result.Platform `json:"platforms,omitempty"`
68+
Platforms []*result.PlatformSummary `json:"platforms,omitempty"`
6969
InstalledLibs []*result.InstalledLibrary `json:"libraries,omitempty"`
7070
}
7171

7272
func newOutdatedResult(inPlatforms []*rpc.PlatformSummary, inLibraries []*rpc.InstalledLibrary) *outdatedResult {
7373
res := &outdatedResult{
74-
Platforms: make([]*result.Platform, len(inPlatforms)),
74+
Platforms: make([]*result.PlatformSummary, len(inPlatforms)),
7575
InstalledLibs: make([]*result.InstalledLibrary, len(inLibraries)),
7676
}
7777
for i, v := range inPlatforms {
78-
res.Platforms[i] = result.NewPlatformResult(v)
78+
res.Platforms[i] = result.NewPlatformSummary(v)
7979
}
8080
for i, v := range inLibraries {
8181
res.InstalledLibs[i] = result.NewInstalledLibraryResult(v)

0 commit comments

Comments
 (0)