From 87abb4eb9cdfc6c2a871daadd22cd5858abc8e29 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 4 May 2021 08:42:49 +0200 Subject: [PATCH] don't invoke r.Close on error as r == nil Signed-off-by: Nicolas De Loof --- local/compose/logs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local/compose/logs.go b/local/compose/logs.go index dea11abc3..c708280e7 100644 --- a/local/compose/logs.go +++ b/local/compose/logs.go @@ -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)