Remove all gogoproto extensions
This commit removes the following gogoproto extensions; - gogoproto.nullable - gogoproto.customename - gogoproto.unmarshaller_all - gogoproto.stringer_all - gogoproto.sizer_all - gogoproto.marshaler_all - gogoproto.goproto_unregonized_all - gogoproto.goproto_stringer_all - gogoproto.goproto_getters_all None of them are supported by Google's toolchain (see #6564). Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
@@ -70,7 +70,7 @@ func (s *remoteImages) Create(ctx context.Context, image images.Image) (images.I
|
||||
return images.Image{}, errdefs.FromGRPC(err)
|
||||
}
|
||||
|
||||
return imageFromProto(&created.Image), nil
|
||||
return imageFromProto(created.Image), nil
|
||||
}
|
||||
|
||||
func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error) {
|
||||
@@ -89,7 +89,7 @@ func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpath
|
||||
return images.Image{}, errdefs.FromGRPC(err)
|
||||
}
|
||||
|
||||
return imageFromProto(&updated.Image), nil
|
||||
return imageFromProto(updated.Image), nil
|
||||
}
|
||||
|
||||
func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error {
|
||||
@@ -107,8 +107,8 @@ func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.D
|
||||
return errdefs.FromGRPC(err)
|
||||
}
|
||||
|
||||
func imageToProto(image *images.Image) imagesapi.Image {
|
||||
return imagesapi.Image{
|
||||
func imageToProto(image *images.Image) *imagesapi.Image {
|
||||
return &imagesapi.Image{
|
||||
Name: image.Name,
|
||||
Labels: image.Labels,
|
||||
Target: descToProto(&image.Target),
|
||||
@@ -121,18 +121,18 @@ func imageFromProto(imagepb *imagesapi.Image) images.Image {
|
||||
return images.Image{
|
||||
Name: imagepb.Name,
|
||||
Labels: imagepb.Labels,
|
||||
Target: descFromProto(&imagepb.Target),
|
||||
Target: descFromProto(imagepb.Target),
|
||||
CreatedAt: protobuf.FromTimestamp(imagepb.CreatedAt),
|
||||
UpdatedAt: protobuf.FromTimestamp(imagepb.UpdatedAt),
|
||||
}
|
||||
}
|
||||
|
||||
func imagesFromProto(imagespb []imagesapi.Image) []images.Image {
|
||||
func imagesFromProto(imagespb []*imagesapi.Image) []images.Image {
|
||||
var images []images.Image
|
||||
|
||||
for _, image := range imagespb {
|
||||
image := image
|
||||
images = append(images, imageFromProto(&image))
|
||||
images = append(images, imageFromProto(image))
|
||||
}
|
||||
|
||||
return images
|
||||
@@ -147,8 +147,8 @@ func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
|
||||
}
|
||||
}
|
||||
|
||||
func descToProto(desc *ocispec.Descriptor) types.Descriptor {
|
||||
return types.Descriptor{
|
||||
func descToProto(desc *ocispec.Descriptor) *types.Descriptor {
|
||||
return &types.Descriptor{
|
||||
MediaType: desc.MediaType,
|
||||
Size_: desc.Size,
|
||||
Digest: desc.Digest.String(),
|
||||
|
Reference in New Issue
Block a user