Merge pull request #1630 from ndeloof/logs_panic

don't invoke r.Close on error as r == nil
This commit is contained in:
Nicolas De loof 2021-05-04 10:40:56 +02:00 committed by GitHub
commit 2c79e63b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -51,11 +51,11 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer
Tail: options.Tail,
Timestamps: options.Timestamps,
})
defer r.Close() // nolint errcheck
if err != nil {
return err
}
defer r.Close() // nolint errcheck
name := getContainerNameWithoutProject(c)
w := utils.GetWriter(name, service, func(event compose.ContainerEvent) {
consumer.Log(name, service, event.Line)