From 62eeaac4376bbf59e1a18d5e18884e9a3885f1cf Mon Sep 17 00:00:00 2001 From: lpessoa Date: Mon, 17 Jan 2022 21:24:02 -0300 Subject: [PATCH] Fixed code format issues --- pkg/commands/docker.go | 2 +- pkg/commands/sort_container_test.go | 48 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pkg/commands/docker.go b/pkg/commands/docker.go index d15df440..b23db8bf 100644 --- a/pkg/commands/docker.go +++ b/pkg/commands/docker.go @@ -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] diff --git a/pkg/commands/sort_container_test.go b/pkg/commands/sort_container_test.go index 08197cd3..5a8cb2a1 100644 --- a/pkg/commands/sort_container_test.go +++ b/pkg/commands/sort_container_test.go @@ -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", },