From 88d872250ed8ec37cb178fd950e475a2fff9137d Mon Sep 17 00:00:00 2001 From: cnfatal Date: Tue, 2 Jan 2024 17:02:47 +0800 Subject: [PATCH] Update dependencies and sort functions --- go.mod | 2 +- go.sum | 4 ++-- pkg/registry/store_fs.go | 4 ++-- pkg/types/types.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 11c8b61..c6bbaa5 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/mholt/archiver/v4 v4.0.0-alpha.7 github.com/opencontainers/go-digest v1.0.0 github.com/spf13/cobra v1.7.0 - golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b golang.org/x/sync v0.1.0 golang.org/x/term v0.7.0 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 3251d6f..31f9720 100644 --- a/go.sum +++ b/go.sum @@ -128,8 +128,8 @@ golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c h1:HDdYQYKOkvJT/Plb5HwJJywTVyUnIctjQm6XSnZ/0CY= -golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= diff --git a/pkg/registry/store_fs.go b/pkg/registry/store_fs.go index 2266ba7..3997a04 100644 --- a/pkg/registry/store_fs.go +++ b/pkg/registry/store_fs.go @@ -143,8 +143,8 @@ func (m *FSRegistryStore) GetIndex(ctx context.Context, repository string, searc } func (m *FSRegistryStore) PutIndex(ctx context.Context, repository string, index types.Index) error { - slices.SortFunc(index.Manifests, func(a, b types.Descriptor) bool { - return strings.Compare(a.Name, b.Name) < 0 + slices.SortFunc(index.Manifests, func(a, b types.Descriptor) int { + return strings.Compare(a.Name, b.Name) }) // use latest manifest annotations as index annotations diff --git a/pkg/types/types.go b/pkg/types/types.go index 1dd4ab3..40403de 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -46,8 +46,8 @@ func (a Annotations) String() string { return strings.Join(result, ",") } -func SortDescriptorName(a, b Descriptor) bool { - return strings.Compare(a.Name, b.Name) < 0 +func SortDescriptorName(a, b Descriptor) int { + return strings.Compare(a.Name, b.Name) } type Index struct {