Skip to content

Commit 2c3cedf

Browse files
comment back code
1 parent 0c285e9 commit 2c3cedf

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Examples/runtimes/go/misc/getEncryptedDataKeyDescription.go

+14-10
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,21 @@ func GetEncryptedDataKeyDescriptionExample(kmsKeyID, ddbTableName string) {
4444
}
4545
returnedItem, err := ddb.GetItem(context.TODO(), getInput)
4646
utils.HandleError(err)
47-
// inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberitem{
48-
// Value: returnedItem.Item,
49-
// }
50-
headerAttribute := "aws_dbe_head"
51-
headerBytes, ok := returnedItem.Item[headerAttribute].(*types.AttributeValueMemberB)
52-
if !ok {
53-
panic("attribute1 is not binary. It might not be encrypted.")
54-
}
55-
inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberheader{
56-
Value: headerBytes.Value,
47+
inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberitem{
48+
Value: returnedItem.Item,
5749
}
50+
51+
// The code below shows how we can send header as the input to the DynamoDB. This code is written to demo the
52+
// alternative approach. So, it is commented.
53+
// headerAttribute := "aws_dbe_head"
54+
// headerBytes, ok := returnedItem.Item[headerAttribute].(*types.AttributeValueMemberB)
55+
// if !ok {
56+
// panic("attribute1 is not binary. It might not be encrypted.")
57+
// }
58+
// inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberheader{
59+
// Value: headerBytes.Value,
60+
// }
61+
5862
encryptedDataKeyDescriptionInput := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionInput{
5963
Input: &inputUnion,
6064
}

0 commit comments

Comments
 (0)