1
0
mirror of https://github.com/containers/skopeo.git synced 2025-05-03 13:36:59 +00:00

Merge pull request from mtrmac/go1.23

Update to benefit from Go 1.23
This commit is contained in:
Miloslav Trmač 2025-03-21 22:12:24 +01:00 committed by GitHub
commit d62cbd6178
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 7 additions and 12 deletions

View File

@ -6,7 +6,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"sort" "maps"
"slices"
"strings" "strings"
"github.com/containers/common/pkg/retry" "github.com/containers/common/pkg/retry"
@ -16,7 +17,6 @@ import (
"github.com/containers/image/v5/transports/alltransports" "github.com/containers/image/v5/transports/alltransports"
"github.com/containers/image/v5/types" "github.com/containers/image/v5/types"
"github.com/spf13/cobra" "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. // 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 // supportedTransports returns all the supported transports
func supportedTransports(joinStr string) string { func supportedTransports(joinStr string) string {
res := maps.Keys(transportHandlers) res := slices.Sorted(maps.Keys(transportHandlers))
sort.Strings(res)
return strings.Join(res, joinStr) return strings.Join(res, joinStr)
} }

View File

@ -1,5 +1,4 @@
//go:build !windows //go:build !windows
// +build !windows
package main package main

View File

@ -1,5 +1,4 @@
//go:build windows //go:build windows
// +build windows
package main package main

View File

@ -1,5 +1,4 @@
//go:build !linux //go:build !linux
// +build !linux
package main package main

2
go.mod
View File

@ -20,7 +20,6 @@ require (
github.com/spf13/cobra v1.9.1 github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6 github.com/spf13/pflag v1.0.6
github.com/stretchr/testify v1.10.0 github.com/stretchr/testify v1.10.0
golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329
golang.org/x/term v0.30.0 golang.org/x/term v0.30.0
gopkg.in/yaml.v3 v3.0.1 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/metric v1.31.0 // indirect
go.opentelemetry.io/otel/trace v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect
golang.org/x/crypto v0.35.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/mod v0.22.0 // indirect
golang.org/x/net v0.36.0 // indirect golang.org/x/net v0.36.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect golang.org/x/oauth2 v0.25.0 // indirect

View File

@ -8,6 +8,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"testing" "testing"
"time" "time"
@ -253,10 +254,10 @@ func (cluster *openshiftCluster) relaxImageSignerPermissions(t *testing.T) {
// tearDown stops the cluster services and deletes (only some!) of the state. // tearDown stops the cluster services and deletes (only some!) of the state.
func (cluster *openshiftCluster) tearDown(t *testing.T) { func (cluster *openshiftCluster) tearDown(t *testing.T) {
for i := len(cluster.processes) - 1; i >= 0; i-- { for _, process := range slices.Backward(cluster.processes) {
// Its undocumented what Kill() returns if the process has terminated, // Its undocumented what Kill() returns if the process has terminated,
// so we couldnt check just for that. This is running in a container anyway… // so we couldnt check just for that. This is running in a container anyway…
_ = cluster.processes[i].Process.Kill() _ = process.Process.Kill()
} }
if cluster.dockerDir != "" { if cluster.dockerDir != "" {
err := os.RemoveAll(cluster.dockerDir) err := os.RemoveAll(cluster.dockerDir)

View File

@ -1,5 +1,4 @@
//go:build openshift_shell //go:build openshift_shell
// +build openshift_shell
package main package main

View File

@ -1,5 +1,4 @@
//go:build !linux //go:build !linux
// +build !linux
package main package main