@@ -67,7 +67,7 @@ func List(instance *rpc.Instance, args []string, all bool, updatable bool) {
67
67
}
68
68
feedback .PrintResult (installedResult {
69
69
onlyUpdates : updatable ,
70
- installedLibs : installedLibsResult ,
70
+ InstalledLibs : installedLibsResult ,
71
71
})
72
72
logrus .Info ("Done" )
73
73
}
@@ -118,24 +118,24 @@ func GetList(
118
118
// output from this command requires special formatting, let's create a dedicated
119
119
// feedback.Result implementation
120
120
type installedResult struct {
121
+ InstalledLibs []* result.InstalledLibrary `json:"installed_libraries"`
121
122
onlyUpdates bool
122
- installedLibs []* result.InstalledLibrary
123
123
}
124
124
125
125
func (ir installedResult ) Data () interface {} {
126
- return ir . installedLibs
126
+ return ir
127
127
}
128
128
129
129
func (ir installedResult ) String () string {
130
- if len (ir .installedLibs ) == 0 {
130
+ if len (ir .InstalledLibs ) == 0 {
131
131
if ir .onlyUpdates {
132
132
return tr ("No libraries update is available." )
133
133
}
134
134
return tr ("No libraries installed." )
135
135
}
136
- sort .Slice (ir .installedLibs , func (i , j int ) bool {
137
- return strings .ToLower (ir .installedLibs [i ].Library .Name ) < strings .ToLower (ir .installedLibs [j ].Library .Name ) ||
138
- strings .ToLower (ir .installedLibs [i ].Library .ContainerPlatform ) < strings .ToLower (ir .installedLibs [j ].Library .ContainerPlatform )
136
+ sort .Slice (ir .InstalledLibs , func (i , j int ) bool {
137
+ return strings .ToLower (ir .InstalledLibs [i ].Library .Name ) < strings .ToLower (ir .InstalledLibs [j ].Library .Name ) ||
138
+ strings .ToLower (ir .InstalledLibs [i ].Library .ContainerPlatform ) < strings .ToLower (ir .InstalledLibs [j ].Library .ContainerPlatform )
139
139
})
140
140
141
141
t := table .New ()
@@ -145,7 +145,7 @@ func (ir installedResult) String() string {
145
145
t .SetColumnWidthMode (4 , table .Average )
146
146
147
147
lastName := ""
148
- for _ , libMeta := range ir .installedLibs {
148
+ for _ , libMeta := range ir .InstalledLibs {
149
149
lib := libMeta .Library
150
150
name := lib .Name
151
151
if name == lastName {
0 commit comments