From 93bffd9a7fc0806c5951cb20096001440b7213ab Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 7 Feb 2023 20:50:15 +0100 Subject: [PATCH] prevent assignment to entry in nil map Signed-off-by: Nicolas De Loof --- pkg/compose/build.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/compose/build.go b/pkg/compose/build.go index 1543852be..1c2b0455a 100644 --- a/pkg/compose/build.go +++ b/pkg/compose/build.go @@ -303,10 +303,10 @@ func (s *composeService) toBuildOptions(project *types.Project, service types.Se } func flatten(in types.MappingWithEquals) types.Mapping { - if len(in) == 0 { - return nil - } out := types.Mapping{} + if len(in) == 0 { + return out + } for k, v := range in { if v == nil { continue