mirror of https://github.com/docker/compose.git
use nicer imports
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
c833e2e4a2
commit
c944c970ab
|
@ -23,13 +23,12 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
formatter3 "github.com/docker/compose-cli/cmd/formatter"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/compose-cli/api/client"
|
||||
"github.com/docker/compose-cli/api/containers"
|
||||
format "github.com/docker/compose-cli/cmd/formatter"
|
||||
"github.com/docker/compose-cli/utils/formatter"
|
||||
)
|
||||
|
||||
|
@ -90,11 +89,11 @@ func runPs(ctx context.Context, opts psOpts) error {
|
|||
}
|
||||
|
||||
if opts.json {
|
||||
opts.format = formatter3.JSON
|
||||
opts.format = format.JSON
|
||||
}
|
||||
|
||||
view := viewFromContainerList(containerList)
|
||||
return formatter3.Print(view, opts.format, os.Stdout, func(w io.Writer) {
|
||||
return format.Print(view, opts.format, os.Stdout, func(w io.Writer) {
|
||||
for _, c := range view {
|
||||
_, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", c.ID, c.Image, c.Command, c.Status,
|
||||
strings.Join(c.Ports, ", "))
|
||||
|
|
|
@ -24,12 +24,11 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
formatter2 "github.com/docker/compose-cli/cmd/formatter"
|
||||
|
||||
"github.com/docker/docker/pkg/stringid"
|
||||
"github.com/docker/go-units"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/docker/compose-cli/cmd/formatter"
|
||||
"github.com/docker/compose-cli/pkg/api"
|
||||
"github.com/docker/compose-cli/pkg/utils"
|
||||
)
|
||||
|
@ -89,7 +88,7 @@ func runImages(ctx context.Context, backend api.Service, opts imageOptions, serv
|
|||
return images[i].ContainerName < images[j].ContainerName
|
||||
})
|
||||
|
||||
return formatter2.Print(images, formatter2.PRETTY, os.Stdout,
|
||||
return formatter.Print(images, formatter.PRETTY, os.Stdout,
|
||||
func(w io.Writer) {
|
||||
for _, img := range images {
|
||||
id := stringid.TruncateID(img.ID)
|
||||
|
|
Loading…
Reference in New Issue