@@ -86,27 +86,27 @@ func runSearchCommand(cmd *cobra.Command, args []string, allVersions bool) {
86
86
// output from this command requires special formatting, let's create a dedicated
87
87
// feedback.Result implementation
88
88
type searchResults struct {
89
- platforms []* result.PlatformSummary
89
+ Platforms []* result.PlatformSummary `json:"platforms"`
90
90
allVersions bool
91
91
}
92
92
93
93
func newSearchResult (in []* rpc.PlatformSummary , allVersions bool ) * searchResults {
94
94
res := & searchResults {
95
- platforms : make ([]* result.PlatformSummary , len (in )),
95
+ Platforms : make ([]* result.PlatformSummary , len (in )),
96
96
allVersions : allVersions ,
97
97
}
98
98
for i , platformSummary := range in {
99
- res .platforms [i ] = result .NewPlatformSummary (platformSummary )
99
+ res .Platforms [i ] = result .NewPlatformSummary (platformSummary )
100
100
}
101
101
return res
102
102
}
103
103
104
104
func (sr searchResults ) Data () interface {} {
105
- return sr . platforms
105
+ return sr
106
106
}
107
107
108
108
func (sr searchResults ) String () string {
109
- if len (sr .platforms ) == 0 {
109
+ if len (sr .Platforms ) == 0 {
110
110
return tr ("No platforms matching your search." )
111
111
}
112
112
@@ -121,7 +121,7 @@ func (sr searchResults) String() string {
121
121
t .AddRow (platform .Id , release .Version , release .FormatName ())
122
122
}
123
123
124
- for _ , platform := range sr .platforms {
124
+ for _ , platform := range sr .Platforms {
125
125
// When allVersions is not requested we only show the latest compatible version
126
126
if ! sr .allVersions {
127
127
addRow (platform , platform .GetLatestRelease ())
0 commit comments