Fixed code format issues

This commit is contained in:
lpessoa 2022-01-17 21:24:02 -03:00
parent cbacd32a68
commit 62eeaac437
No known key found for this signature in database
GPG key ID: EE95569A130570F0
2 changed files with 25 additions and 25 deletions

View file

@ -287,7 +287,7 @@ func (c *DockerCommand) sortedContainers(containers []*Container) []*Container {
sort.Slice(containers, func(i, j int) bool {
stateLeft := states[containers[i].Container.State]
stateRight := states[containers[j].Container.State]
if stateLeft == stateRight {
if stateLeft == stateRight {
return containers[i].Name < containers[j].Name
}
return states[containers[i].Container.State] < states[containers[j].Container.State]

View file

@ -10,32 +10,32 @@ import (
func sampleContainers(userConfig *config.AppConfig) []*Container {
return []*Container{
{
ID: "1",
Name:"1",
ID: "1",
Name: "1",
Container: types.Container{
State: "exited",
},
Config: userConfig,
},
{
ID: "2",
Name:"2",
ID: "2",
Name: "2",
Container: types.Container{
State: "running",
},
Config: userConfig,
},
{
ID: "3",
Name:"3",
ID: "3",
Name: "3",
Container: types.Container{
State: "running",
},
Config: userConfig,
},
{
ID: "4",
Name:"4",
ID: "4",
Name: "4",
Container: types.Container{
State: "created",
},
@ -47,32 +47,32 @@ func sampleContainers(userConfig *config.AppConfig) []*Container {
func expectedPerStatusContainers(appConfig *config.AppConfig) []*Container {
return []*Container{
{
ID: "2",
Name:"2",
ID: "2",
Name: "2",
Container: types.Container{
State: "running",
},
Config: appConfig,
},
{
ID: "3",
Name:"3",
ID: "3",
Name: "3",
Container: types.Container{
State: "running",
},
Config: appConfig,
},
{
ID: "1",
Name:"1",
ID: "1",
Name: "1",
Container: types.Container{
State: "exited",
},
Config: appConfig,
},
{
ID: "4",
Name:"4",
ID: "4",
Name: "4",
Container: types.Container{
State: "created",
},
@ -84,32 +84,32 @@ func expectedPerStatusContainers(appConfig *config.AppConfig) []*Container {
func expectedLegacySortedContainers(appConfig *config.AppConfig) []*Container {
return []*Container{
{
ID: "1",
Name:"1",
ID: "1",
Name: "1",
Container: types.Container{
State: "exited",
},
Config: appConfig,
},
{
ID: "2",
Name:"2",
ID: "2",
Name: "2",
Container: types.Container{
State: "running",
},
Config: appConfig,
},
{
ID: "3",
Name:"3",
ID: "3",
Name: "3",
Container: types.Container{
State: "running",
},
Config: appConfig,
},
{
ID: "4",
Name:"4",
ID: "4",
Name: "4",
Container: types.Container{
State: "created",
},