Explorar o código

prevent assignment to entry in nil map

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof %!s(int64=2) %!d(string=hai) anos
pai
achega
93bffd9a7f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      pkg/compose/build.go

+ 2 - 2
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 {
+	out := types.Mapping{}
 	if len(in) == 0 {
-		return nil
+		return out
 	}
-	out := types.Mapping{}
 	for k, v := range in {
 		if v == nil {
 			continue