1
0
mirror of https://github.com/containers/buildah.git synced 2026-02-05 09:45:38 +01:00

Use maps.Copy

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2025-04-07 12:52:10 -07:00
parent 76e58eea14
commit f261d6641c
5 changed files with 10 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
package config
import (
"maps"
"slices"
"github.com/containers/image/v5/manifest"
@@ -25,9 +26,7 @@ func Schema2ConfigFromGoDockerclientConfig(config *dockerclient.Config) *manifes
}
}
labels := make(map[string]string)
for k, v := range config.Labels {
labels[k] = v
}
maps.Copy(labels, config.Labels)
volumes := make(map[string]struct{})
for v := range config.Volumes {
volumes[v] = struct{}{}
@@ -82,9 +81,7 @@ func GoDockerclientConfigFromSchema2Config(s2config *manifest.Schema2Config) *do
}
}
labels := make(map[string]string)
for k, v := range s2config.Labels {
labels[k] = v
}
maps.Copy(labels, s2config.Labels)
volumes := make(map[string]struct{})
for v := range s2config.Volumes {
volumes[v] = struct{}{}