From 40833fd2965598ddf191064a13681741d81d155e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 5 Nov 2024 10:06:50 +0100 Subject: [PATCH] cli/compose/loader: remove redundant capturing of loop vars (copyloopvar) go1.22 and up now produce a unique variable in loops, tehrefore no longer requiring to capture the variable manually; cli/compose/loader/merge.go:71:3: The copy of the 'for' variable "overrideService" can be deleted (Go 1.22+) (copyloopvar) overrideService := overrideService ^ Signed-off-by: Sebastiaan van Stijn --- cli/compose/loader/merge.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index 94c4eebcea..15fc69b853 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -68,7 +68,6 @@ func mergeServices(base, override []types.ServiceConfig) ([]types.ServiceConfig, }, } for name, overrideService := range overrideServices { - overrideService := overrideService if baseService, ok := baseServices[name]; ok { if err := mergo.Merge(&baseService, &overrideService, mergo.WithAppendSlice, mergo.WithOverride, mergo.WithTransformers(specials)); err != nil { return base, errors.Wrapf(err, "cannot merge service %s", name)