diff --git a/cmd/skopeo/list_tags.go b/cmd/skopeo/list_tags.go index fa271e44..4b16f506 100644 --- a/cmd/skopeo/list_tags.go +++ b/cmd/skopeo/list_tags.go @@ -6,7 +6,8 @@ import ( "errors" "fmt" "io" - "sort" + "maps" + "slices" "strings" "github.com/containers/common/pkg/retry" @@ -16,7 +17,6 @@ import ( "github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/types" "github.com/spf13/cobra" - "golang.org/x/exp/maps" ) // tagListOutput is the output format of (skopeo list-tags), primarily so that we can format it with a simple json.MarshalIndent. @@ -38,8 +38,7 @@ var transportHandlers = map[string]func(ctx context.Context, sys *types.SystemCo // supportedTransports returns all the supported transports func supportedTransports(joinStr string) string { - res := maps.Keys(transportHandlers) - sort.Strings(res) + res := slices.Sorted(maps.Keys(transportHandlers)) return strings.Join(res, joinStr) } diff --git a/cmd/skopeo/proxy.go b/cmd/skopeo/proxy.go index b1389396..1a26a0fd 100644 --- a/cmd/skopeo/proxy.go +++ b/cmd/skopeo/proxy.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package main diff --git a/cmd/skopeo/proxy_windows.go b/cmd/skopeo/proxy_windows.go index 332b0c2f..3e766c2b 100644 --- a/cmd/skopeo/proxy_windows.go +++ b/cmd/skopeo/proxy_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package main diff --git a/cmd/skopeo/unshare.go b/cmd/skopeo/unshare.go index c31e403b..29c81421 100644 --- a/cmd/skopeo/unshare.go +++ b/cmd/skopeo/unshare.go @@ -1,5 +1,4 @@ //go:build !linux -// +build !linux package main diff --git a/go.mod b/go.mod index 5e376be2..3bba2ba4 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,6 @@ require ( github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 github.com/stretchr/testify v1.10.0 - golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 golang.org/x/term v0.30.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -124,6 +123,7 @@ require ( go.opentelemetry.io/otel/metric v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect golang.org/x/crypto v0.35.0 // indirect + golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.36.0 // indirect golang.org/x/oauth2 v0.25.0 // indirect diff --git a/integration/openshift.go b/integration/openshift.go index 267b734c..b7a1792b 100644 --- a/integration/openshift.go +++ b/integration/openshift.go @@ -8,6 +8,7 @@ import ( "os" "os/exec" "path/filepath" + "slices" "strings" "testing" "time" @@ -253,10 +254,10 @@ func (cluster *openshiftCluster) relaxImageSignerPermissions(t *testing.T) { // tearDown stops the cluster services and deletes (only some!) of the state. func (cluster *openshiftCluster) tearDown(t *testing.T) { - for i := len(cluster.processes) - 1; i >= 0; i-- { + for _, process := range slices.Backward(cluster.processes) { // It’s undocumented what Kill() returns if the process has terminated, // so we couldn’t check just for that. This is running in a container anyway… - _ = cluster.processes[i].Process.Kill() + _ = process.Process.Kill() } if cluster.dockerDir != "" { err := os.RemoveAll(cluster.dockerDir) diff --git a/integration/openshift_shell_test.go b/integration/openshift_shell_test.go index e44b189d..0bce9453 100644 --- a/integration/openshift_shell_test.go +++ b/integration/openshift_shell_test.go @@ -1,5 +1,4 @@ //go:build openshift_shell -// +build openshift_shell package main diff --git a/integration/procutils.go b/integration/procutils.go index e53f94b5..88ca3690 100644 --- a/integration/procutils.go +++ b/integration/procutils.go @@ -1,5 +1,4 @@ //go:build !linux -// +build !linux package main