Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 2c79e63

Browse files
authored
Merge pull request #1630 from ndeloof/logs_panic
don't invoke r.Close on error as r == nil
2 parents de8834d + 87abb4e commit 2c79e63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

local/compose/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer
5151
Tail: options.Tail,
5252
Timestamps: options.Timestamps,
5353
})
54-
defer r.Close() // nolint errcheck
55-
5654
if err != nil {
5755
return err
5856
}
57+
defer r.Close() // nolint errcheck
58+
5959
name := getContainerNameWithoutProject(c)
6060
w := utils.GetWriter(name, service, func(event compose.ContainerEvent) {
6161
consumer.Log(name, service, event.Line)

0 commit comments

Comments
 (0)