mirror of
https://github.com/docker/compose.git
synced 2025-07-26 07:04:32 +02:00
fix: lint
Signed-off-by: MohammadHasan Akbari <116190942+jarqvi@users.noreply.github.com> Signed-off-by: MohammadHasan Akbari <jarqvi.jarqvi@gmail.com>
This commit is contained in:
parent
b9d0c77cde
commit
bf0418bac1
@ -69,7 +69,16 @@ func (s *composeService) export(ctx context.Context, projectName string, options
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer responseBody.Close()
|
defer func() {
|
||||||
|
if err := responseBody.Close(); err != nil {
|
||||||
|
w.Event(progress.Event{
|
||||||
|
ID: name,
|
||||||
|
Text: msg,
|
||||||
|
Status: progress.Error,
|
||||||
|
StatusText: fmt.Sprintf("Failed to close response body: %v", err),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if !s.dryRun {
|
if !s.dryRun {
|
||||||
if options.Output == "" {
|
if options.Output == "" {
|
||||||
@ -77,7 +86,7 @@ func (s *composeService) export(ctx context.Context, projectName string, options
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = command.CopyToFile(options.Output, responseBody); err != nil {
|
if err := command.CopyToFile(options.Output, responseBody); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,4 +48,3 @@ func TestExportWithReplicas(t *testing.T) {
|
|||||||
c.RunDockerComposeCmd(t, "--project-name", projectName, "export", "-o", "r1.tar", "--index=1", "service-with-replicas")
|
c.RunDockerComposeCmd(t, "--project-name", projectName, "export", "-o", "r1.tar", "--index=1", "service-with-replicas")
|
||||||
c.RunDockerComposeCmd(t, "--project-name", projectName, "export", "-o", "r2.tar", "--index=2", "service-with-replicas")
|
c.RunDockerComposeCmd(t, "--project-name", projectName, "export", "-o", "r2.tar", "--index=2", "service-with-replicas")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user