Merge pull request #2551 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"
"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)
}

View File

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

View File

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

View File

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

2
go.mod
View File

@ -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

View File

@ -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) {
// Its undocumented what Kill() returns if the process has terminated,
// 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 != "" {
err := os.RemoveAll(cluster.dockerDir)

View File

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

View File

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