Skip to content

Commit

Permalink
images: Change 'any' to 'anything' to avoid clash with built-in type …
Browse files Browse the repository at this point in the history
…'any'

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed May 1, 2023
1 parent 5780ecc commit 002abac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cmd/ctd-decoder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ func getPayload() (*imgcrypt.Payload, error) {
if err != nil {
return nil, fmt.Errorf("read payload: %w", err)
}
var any types.Any
if err := proto.Unmarshal(data, &any); err != nil {
var anything types.Any
if err := proto.Unmarshal(data, &anything); err != nil {
return nil, fmt.Errorf("could not proto.Unmarshal() decrypt data: %w", err)
}
v, err := typeurl.UnmarshalAny(&any)
v, err := typeurl.UnmarshalAny(&anything)
if err != nil {
return nil, fmt.Errorf("could not UnmarshalAny() the decrypt data: %w", err)
}
l, ok := v.(*imgcrypt.Payload)
if !ok {
return nil, fmt.Errorf("unknown payload type %s", any.TypeUrl)
return nil, fmt.Errorf("unknown payload type %s", anything.TypeUrl)
}
return l, nil
}
4 changes: 2 additions & 2 deletions images/encryption/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ import (
func WithDecryptedUnpack(data *imgcrypt.Payload) diff.ApplyOpt {
return func(_ context.Context, desc ocispec.Descriptor, c *diff.ApplyConfig) error {
data.Descriptor = desc
any, err := typeurl.MarshalAny(data)
anything, err := typeurl.MarshalAny(data)
if err != nil {
return fmt.Errorf("failed to marshal payload: %w", err)
}

for _, id := range imgcrypt.PayloadToolIDs {
setProcessorPayload(c, id, any)
setProcessorPayload(c, id, anything)
}
return nil
}
Expand Down

0 comments on commit 002abac

Please sign in to comment.