@@ -308,6 +308,12 @@ func (tp truncatedPlatforms) String() string {
308308 var out []string
309309 var count int
310310
311+ var keys []string
312+ for k := range tp .res {
313+ keys = append (keys , k )
314+ }
315+ sort .Strings (keys )
316+
311317 seen := make (map [string ]struct {})
312318 for _ , mpf := range truncMajorPlatforms {
313319 if tpf , ok := tp .res [mpf ]; ok {
@@ -333,19 +339,19 @@ func (tp truncatedPlatforms) String() string {
333339 }
334340 }
335341
336- for mpf , pf := range tp . res {
342+ for _ , mpf := range keys {
337343 if len (out ) >= tp .max {
338344 break
339345 }
340346 if _ , ok := seen [mpf ]; ok {
341347 continue
342348 }
343- if len (pf ) == 1 {
344- out = append (out , fmt .Sprintf ("%s" , pf [0 ]))
349+ if len (tp . res [ mpf ] ) == 1 {
350+ out = append (out , fmt .Sprintf ("%s" , tp . res [ mpf ] [0 ]))
345351 count ++
346352 } else {
347353 hasPreferredPlatform := false
348- for _ , pf := range pf {
354+ for _ , pf := range tp . res [ mpf ] {
349355 if strings .HasSuffix (pf , "*" ) {
350356 hasPreferredPlatform = true
351357 break
@@ -355,8 +361,8 @@ func (tp truncatedPlatforms) String() string {
355361 if hasPreferredPlatform {
356362 mainpf += "*"
357363 }
358- out = append (out , fmt .Sprintf ("%s (+%d)" , mainpf , len (pf )))
359- count += len (pf )
364+ out = append (out , fmt .Sprintf ("%s (+%d)" , mainpf , len (tp . res [ mpf ] )))
365+ count += len (tp . res [ mpf ] )
360366 }
361367 }
362368
0 commit comments