Skip to content

Commit f0d17cc

Browse files
cli: core search
1 parent cdb13e0 commit f0d17cc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: internal/cli/core/search.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,26 @@ 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.PlatformSummary
91+
Platforms []*result.PlatformSummary `json:"platforms"`
9292
}
9393

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

102102
func (sr searchResults) Data() interface{} {
103-
return sr.platforms
103+
return sr
104104
}
105105

106106
func (sr searchResults) String() string {
107-
if len(sr.platforms) > 0 {
107+
if len(sr.Platforms) > 0 {
108108
t := table.New()
109109
t.SetHeader(tr("ID"), tr("Version"), tr("Name"))
110-
for _, platform := range sr.platforms {
110+
for _, platform := range sr.Platforms {
111111
name := ""
112112
if latest := platform.GetLatestRelease(); latest != nil {
113113
name = latest.Name

0 commit comments

Comments
 (0)