Refactor to use maps.Copy

Signed-off-by: cuiweixie <cuiweixie@gmail.com>
This commit is contained in:
cuiweixie 2025-08-23 22:31:48 +08:00 committed by Nicolas De loof
parent f266715dd0
commit 3bac9ffd08

View File

@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"maps"
"slices"
"sort"
"strconv"
@ -931,9 +932,7 @@ func (s *composeService) startService(ctx context.Context,
func mergeLabels(ls ...types.Labels) types.Labels {
merged := types.Labels{}
for _, l := range ls {
for k, v := range l {
merged[k] = v
}
maps.Copy(merged, l)
}
return merged
}