Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
g
  • Loading branch information
vicentepinto98 committed Jan 9, 2025
1 parent 6b0eac5 commit 09c5ca9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions internal/cmd/beta/sqlserverflex/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ func outputResultAsTable(p *print.Printer, model *inputModel, options *options)
content = append(content, buildVersionsTable(*options.Versions))
}
if model.Storages && options.Storages.Storages != nil && len(*options.Storages.Storages.StorageClasses) != 0 {
storagesTable := buildStoragesTable(*options.Storages.Storages.StorageClasses, *options.Storages.Storages.StorageRange.Min, *options.Storages.Storages.StorageRange.Max)
content = append(content, storagesTable)
content = append(content, buildStoragesTable(*options.Storages.Storages))
}
if model.UserRoles && len(options.UserRoles.UserRoles) != 0 {
content = append(content, buildUserRoles(options.UserRoles))
Expand Down Expand Up @@ -352,13 +351,14 @@ func buildVersionsTable(versions []string) tables.Table {
return table
}

func buildStoragesTable(storageClasses []string, min, max int64) tables.Table {
func buildStoragesTable(storagesResp sqlserverflex.ListStoragesResponse) tables.Table {
storages := *storagesResp.StorageClasses
table := tables.NewTable()
table.SetTitle("Storages")
table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS")
for i := range storageClasses {
sc := storageClasses[i]
table.AddRow(min, max, sc)
for i := range storages {
sc := storages[i]
table.AddRow(*storagesResp.StorageRange.Min, *storagesResp.StorageRange.Max, sc)
}
table.EnableAutoMergeOnColumns(1, 2, 3)
return table
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/mongodbflex/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ func outputResultAsTable(p *print.Printer, model *inputModel, options *options)
content = append(content, buildVersionsTable(*options.Versions))
}
if model.Storages && options.Storages.Storages != nil && len(*options.Storages.Storages.StorageClasses) == 0 {
storagesTable := buildStoragesTable(*options.Storages.Storages.StorageClasses, *options.Storages.Storages.StorageRange.Min, *options.Storages.Storages.StorageRange.Max)
content = append(content, storagesTable)
content = append(content, buildStoragesTable(*options.Storages.Storages))
}

err := tables.DisplayTables(p, content)
Expand Down Expand Up @@ -248,13 +247,14 @@ func buildVersionsTable(versions []string) tables.Table {
return table
}

func buildStoragesTable(storageClasses []string, min, max int64) tables.Table {
func buildStoragesTable(storagesResp mongodbflex.ListStoragesResponse) tables.Table {
storages := *storagesResp.StorageClasses
table := tables.NewTable()
table.SetTitle("Storages")
table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS")
for i := range storageClasses {
sc := storageClasses[i]
table.AddRow(min, max, sc)
for i := range storages {
sc := storages[i]
table.AddRow(*storagesResp.StorageRange.Min, *storagesResp.StorageRange.Max, sc)
}
table.EnableAutoMergeOnColumns(1, 2, 3)
return table
Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/postgresflex/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ func outputResultAsTable(p *print.Printer, model *inputModel, options *options)
content = append(content, buildVersionsTable(*options.Versions))
}
if model.Storages && options.Storages.Storages != nil && len(*options.Storages.Storages.StorageClasses) == 0 {
storagesTable := buildStoragesTable(*options.Storages.Storages.StorageClasses, *options.Storages.Storages.StorageRange.Min, *options.Storages.Storages.StorageRange.Max)
content = append(content, storagesTable)
content = append(content, buildStoragesTable(*options.Storages.Storages))
}

err := tables.DisplayTables(p, content)
Expand Down Expand Up @@ -248,13 +247,14 @@ func buildVersionsTable(versions []string) tables.Table {
return table
}

func buildStoragesTable(storageClasses []string, min, max int64) tables.Table {
func buildStoragesTable(storagesResp postgresflex.ListStoragesResponse) tables.Table {
storages := *storagesResp.StorageClasses
table := tables.NewTable()
table.SetTitle("Storages")
table.SetHeader("MINIMUM", "MAXIMUM", "STORAGE CLASS")
for i := range storageClasses {
sc := storageClasses[i]
table.AddRow(min, max, sc)
for i := range storages {
sc := storages[i]
table.AddRow(*storagesResp.StorageRange.Min, *storagesResp.StorageRange.Max, sc)
}
table.EnableAutoMergeOnColumns(1, 2, 3)
return table
Expand Down

0 comments on commit 09c5ca9

Please sign in to comment.