mirror of
https://github.com/docker/compose.git
synced 2025-07-13 16:54:25 +02:00
lint: Fix linting errors
Signed-off-by: Chris Crone <christopher.crone@docker.com>
This commit is contained in:
parent
2c9cc00e0c
commit
a4a3a38dd8
@ -19,16 +19,14 @@ package compose
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/docker/compose-cli/api/context/store"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/compose"
|
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/client"
|
"github.com/docker/compose-cli/api/client"
|
||||||
|
"github.com/docker/compose-cli/api/compose"
|
||||||
|
"github.com/docker/compose-cli/api/context/store"
|
||||||
"github.com/docker/compose-cli/api/progress"
|
"github.com/docker/compose-cli/api/progress"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ package compose
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/client"
|
"github.com/docker/compose-cli/api/client"
|
||||||
|
@ -19,20 +19,19 @@ package compose
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/docker/docker/errdefs"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/compose"
|
|
||||||
|
|
||||||
"github.com/docker/compose-cli/api/progress"
|
|
||||||
|
|
||||||
"github.com/compose-spec/compose-go/cli"
|
"github.com/compose-spec/compose-go/cli"
|
||||||
"github.com/compose-spec/compose-go/types"
|
"github.com/compose-spec/compose-go/types"
|
||||||
moby "github.com/docker/docker/api/types"
|
moby "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/api/types/filters"
|
"github.com/docker/docker/api/types/filters"
|
||||||
|
"github.com/docker/docker/errdefs"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
|
|
||||||
|
"github.com/docker/compose-cli/api/compose"
|
||||||
|
"github.com/docker/compose-cli/api/progress"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *composeService) Down(ctx context.Context, projectName string, options compose.DownOptions) error {
|
func (s *composeService) Down(ctx context.Context, projectName string, options compose.DownOptions) error {
|
||||||
@ -96,7 +95,7 @@ func (s *composeService) Down(ctx context.Context, projectName string, options c
|
|||||||
image := image
|
image := image
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
resourceToRemove = true
|
resourceToRemove = true
|
||||||
return s.removeImage(image, w, err, ctx)
|
return s.removeImage(ctx, image, w)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -122,10 +121,10 @@ func (s *composeService) getServiceImages(options compose.DownOptions, projectNa
|
|||||||
return images
|
return images
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) removeImage(image string, w progress.Writer, err error, ctx context.Context) error {
|
func (s *composeService) removeImage(ctx context.Context, image string, w progress.Writer) error {
|
||||||
id := fmt.Sprintf("Image %s", image)
|
id := fmt.Sprintf("Image %s", image)
|
||||||
w.Event(progress.NewEvent(id, progress.Working, "Removing"))
|
w.Event(progress.NewEvent(id, progress.Working, "Removing"))
|
||||||
_, err = s.apiClient.ImageRemove(ctx, image, moby.ImageRemoveOptions{})
|
_, err := s.apiClient.ImageRemove(ctx, image, moby.ImageRemoveOptions{})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
w.Event(progress.NewEvent(id, progress.Done, "Removed"))
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user