Skip to content

Commit

Permalink
Sort region by country code (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Etourneau Gwenn authored Jun 29, 2023
1 parent 64cf685 commit 64fe2dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/formatter/cloud_regions.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func NewCloudRegionFormat(source string) Format {
// CloudRegionWrite renders the context for a list of cloud regions
func CloudRegionWrite(ctx Context, cloudRegions []ybmclient.RegionListResponseDataItem) error {
sort.Slice(cloudRegions, func(i, j int) bool {
return string(cloudRegions[i].Name) < string(cloudRegions[j].Name)
return string(cloudRegions[i].CountryCode) < string(cloudRegions[j].CountryCode)
})
render := func(format func(subContext SubContext) error) error {
for _, cloudRegion := range cloudRegions {
Expand Down

0 comments on commit 64fe2dc

Please sign in to comment.