refactor: more conventional name for method
This commit is contained in:
parent
60a70d2d83
commit
337d3e9ae1
@ -58,7 +58,7 @@ type App struct {
|
|||||||
type Name = string
|
type Name = string
|
||||||
type AppsCatalogue map[Name]App
|
type AppsCatalogue map[Name]App
|
||||||
|
|
||||||
func (a AppsCatalogue) ToList() []App {
|
func (a AppsCatalogue) Flatten() []App {
|
||||||
apps := make([]App, 0, len(a))
|
apps := make([]App, 0, len(a))
|
||||||
for name := range a {
|
for name := range a {
|
||||||
apps = append(apps, a[name])
|
apps = append(apps, a[name])
|
||||||
@ -175,7 +175,7 @@ var recipeListCommand = &cli.Command{
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatal(err.Error())
|
logrus.Fatal(err.Error())
|
||||||
}
|
}
|
||||||
apps := catalogue.ToList()
|
apps := catalogue.Flatten()
|
||||||
sort.Sort(ByAppName(apps))
|
sort.Sort(ByAppName(apps))
|
||||||
tableCol := []string{"Name", "Category", "Status"}
|
tableCol := []string{"Name", "Category", "Status"}
|
||||||
table := createTable(tableCol)
|
table := createTable(tableCol)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user